Actually it looks like this: Clojure 1.8 has a pretty good answer, and the template is already in Clojure 1.7 using map-index .
Ideally, I need a map-index that accepts several collections, such as map , but this will be done. It looks pretty clojuresque, unlike my kludgy fold on the range.
(defn combine-with [op a-coll] (fn [i b-el] (op (a-coll i) b-el))) (map-indexed (combine-with + a) b)
You just have to wait 1.8 for performance: http://dev.clojure.org/jira/browse/CLJ-1553
Below are some timings for a 6-core processor:
(def irange (vec (range (count a)))) ; precompute (c/quick-bench (def ab (r/foldcat (r/map
source share