Skip to content

Instantly share code, notes, and snippets.

@RutledgePaulV
Created July 29, 2016 02:56
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 RutledgePaulV/43ee857ff0d7c97dc23bf475a82d1a5c to your computer and use it in GitHub Desktop.
Save RutledgePaulV/43ee857ff0d7c97dc23bf475a82d1a5c to your computer and use it in GitHub Desktop.
Macro to convert variadic provided symbols into a map of symbol-turned-keyword -> symbol-value
(defmacro map-symbols [& symbols]
"Converts variadic provided symbols into a map of symbol-turned-keyword -> symbol-value"
(into {} (map #(hash-map (keyword (name %)) (var-get (resolve %))) symbols)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment