-
-
Save si14/0dadea5bd7f23de47544 to your computer and use it in GitHub Desktop.
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
(def ^{:dynamic true} testvar) | |
(defmacro test1 [& body] | |
(let [important-data 42] | |
`(binding [testvar ~important-data] | |
~@body))) | |
(defmacro test2 [] | |
(prn "compile time:" testvar) ;; unbound | |
`(prn "run time: " testvar) ;; 42) | |
(test1 (+ 1 2) (test2) :ok) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment