Skip to content

Instantly share code, notes, and snippets.

@fffej
Created August 4, 2009 07:19
Show Gist options
  • Save fffej/161078 to your computer and use it in GitHub Desktop.
Save fffej/161078 to your computer and use it in GitHub Desktop.
(defn vector-map-slow
"A version of map that only works on vectors"
[f v]
(loop [i 0 out [] n (count v)]
(if (<= n i)
out
(recur (inc i) (conj out (f (v i))) n))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment