Calling flatten on anything that is not 'sequential?' returns an empty
sequence:
(flatten 1); => ()
(flatten "Hi"); => ()
With sets if feels somewhat strange:
(flatten #{#{:a} #{:b :c}}); => ()
For some reason I expected #{#{:a} #{:b :c}} to equal #{:a :b :c}.
Ok, the docstring says: "Takes any nested combination of sequential
things...", and sets are not sequential...
But then, why
(reduce + (flatten #{1 2})); => 0
(r/reduce + (r/flatten #{1 2})); => 3 ?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en