On Jul 14, 2010, at 2:40 PM, Cam wrote:

> I definitely like this version a little better. If you change the else
> of the if to be just (list), it returns the empty list just as core/
> flatten does. Mind if I update the ticket with this patch?

It's all yours.  Really, just a slight change from your code anyway.

I wonder about the call to next.  I'm thinking it should be rest instead.  (See 
http://clojure.org/lazy)

I definitely don't like the way (flatten 10)  and (flatten {:a 1 :b 2}) return 
the empty list (in 1.2 beta).  I think these are accidents, and I worry that 
they will obscure higher-level bugs.

My preference is to return the arg if it's not sequential? as I believe it will 
provide a more useful result at no extra cost.  In that case, the argument to 
flatten was probably a mistake, and it's better if the value shows up somewhere 
rather than being mysteriously swallowed.  On the other hand, it might make 
sense to return (list arg) on the theory that flatten should always return a 
seq.  I could live with that.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to