Should not it be empty colection instead?
It seems odd to me since it is inconsistent and forces to consider one
more case (nil or collection).
And another question. I have written this function
(defn index-by
"Make map (f x) -> x"
[f coll]
(reduce #(assoc %1 (f %2) %2) {} coll))
I wonder, is there already such function somewhere in Clojure libraries?
--
Petr Gladkikh
--
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