Created
July 31, 2014 19:23
-
-
Save loganlinn/1d3296706106a96b8ca8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 mapv-indexed | |
[f coll] | |
(let [v (transient [])] | |
(loop [idx 0 | |
coll (seq coll)] | |
(when coll | |
(conj! v (f idx (first coll))) | |
(recur (inc idx) (next coll)))) | |
(persistent! v))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment