(mapv f coll) (mapv f c1 c2) (mapv f c1 c2 c3) (mapv f c1 c2 c3 & colls)
Returns a vector consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments.
(mapv inc [1 2 3 4 5])
;;=> [2 3 4 5 6]
;; map can be used with multiple collections. Collections will be consumed
;; and passed to the mapping function in parallel:
(mapv + [1 2 3] [4 5 6])
;;=> [5 7 9]
;; When map is passed more than one collection, the mapping function will
;; be applied until one of the collections runs out:
(mapv + [1 2 3] (iterate inc 1))
;;=> [2 4 6]
;; map is often used in conjunction with the # reader macro:
(mapv #(str "Hello " % "!" ) ["Ford" "Arthur" "Tricia"])
;;=> ["Hello Ford!" "Hello Arthur!" "Hello Tricia!"]
;; A useful idiom to pull "columns" out of a collection of collections.
;; Note, it is equivalent to:
;; (mapv vector [:a :b :c] [:d :e :f] [:g :h :i])
(apply mapv vector [[:a :b :c]
[:d :e :f]
[:g :h :i]])
;;=> [[:a :d :g] [:b :e :h] [:c :f :i]]