Created
July 7, 2016 17:32
-
-
Save noisesmith/3490f2d3ed98e294e033b002bc2de178 to your computer and use it in GitHub Desktop.
capturing locals in clojure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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