Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noisesmith/3490f2d3ed98e294e033b002bc2de178 to your computer and use it in GitHub Desktop.
Save noisesmith/3490f2d3ed98e294e033b002bc2de178 to your computer and use it in GitHub Desktop.
capturing locals in clojure
kingfisher.core=> (defmacro locals-map [] (into {} (for [[sym val] &env] [(keyword (name sym)) sym])))
#'kingfisher.core/locals-map
kingfisher.core=> (let [a 0 b 1] (locals-map))
{:a 0, :b 1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment