Skip to content

Instantly share code, notes, and snippets.

Created March 25, 2010 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/343522 to your computer and use it in GitHub Desktop.
Save anonymous/343522 to your computer and use it in GitHub Desktop.
(defn zipmap
"Returns a map with the keys mapped to the corresponding vals."
[keys vals]
(loop [map {}
ks (seq keys)
vs (seq vals)]
(if (and ks vs)
(recur (assoc map (first ks) (first vs))
(next ks)
(next vs))
map)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment