2010/6/11 Nathan Sorenson <n...@sfu.ca>: > Is there a way to fold over multiple sequences, in the same way that > 'map' can apply a multi-parameter function over several seqs? In other > words, is there a function like this:
There is no need for a special purpose reduce* function. Using destructing binding as Sean explains and creating an intermediate lazy sequence of key/value pairs, this leads to short and concise code: (reduce (fn [m [k v]] (assoc m k v)) {} (map vector [:one :another] (iterate inc 1))) A good example of Alan J. Perlis quote and Clojure rationale: "It is better to have 100 functions operate on one data structure than to have 10 functions operate on 10 data structures." Jürgen -- 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