Skip to content

Instantly share code, notes, and snippets.

@athos
Forked from syou6162/hash-map-by-names.clj
Created August 17, 2012 11:36
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 athos/3378201 to your computer and use it in GitHub Desktop.
Save athos/3378201 to your computer and use it in GitHub Desktop.
(defmacro hash-map-by-names [names]
(zipmap (map keyword names) names))
(def x 100)
(def y 200)
(let [y 2
z 3]
(hash-map-by-names [x y])) ; {:y 2, :x 100}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment