Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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