Hello,

other solutions: 

(apply hash-map (apply concat [[:a 1] [:b 3] [:e 5] [:c 1]]))
or

(apply hash-map (mapcat identity [[:a 1] [:b 3] [:e 5] [:c 1]]))

I didn't find any function equivalent to "apply concat".
Is there something like a monadic join function for sequence in the API?

Best regards,

Nicolas.


On Tue, 2009-06-23 at 15:09 -0700, samppi wrote:
> The idiom (into {} coll-of-entries) is often used to create a map from
> a collection of entries or two-sized vectors. But what if I want to do
> something like this:
> 
> (mystery-fn [[:a 1] [:b 3] [:b 5] [:c 1]]) ; returns {:a [1], :b [3
> 5], :c [1]})
> 
> The only way I can think of doing this is with a complex loop
> construction. But can mystery-fn be built without resorting to that?
> What would be the best way?
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
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