Created
February 19, 2014 02:48
-
-
Save AlexBaranosky/9085169 to your computer and use it in GitHub Desktop.
How to make a var dynamic at runtime
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
;; 1. eval this | |
(def x 1) | |
;; 2. eval this | |
(binding [x 2] | |
(println x)) | |
;; 3. eval this | |
(.setDynamic #'x) | |
;; 4. eval this | |
(binding [x 2] | |
(println x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment