Skip to content

Instantly share code, notes, and snippets.

@drone29a
Created April 2, 2009 15:23
Show Gist options
  • Save drone29a/89249 to your computer and use it in GitHub Desktop.
Save drone29a/89249 to your computer and use it in GitHub Desktop.
(defn domap
"A map for side-effects. The argument order is the same as map, but
unlike map the function results are not retained. Takes a function
followed by any number of collections and applies the function to the
first item in each coll, then the second etc. Returns nil."
[fn & colls]
(let [num-colls (count colls)]
(doseq [args (partition num-colls (apply interleave colls))]
(apply fn args))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment