Created
April 2, 2009 15:23
-
-
Save drone29a/89249 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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