Last active
March 25, 2017 17:41
-
-
Save sw-samuraj/774c71d072e56e36d6c235d5ef832ec0 to your computer and use it in GitHub Desktop.
An example of Var re-binding (dynamic).
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 *dynamic-var* "dynamic var") | |
*dynamic-var* | |
;; -> "dynamic var" | |
(def re-binded-var | |
(binding [*dynamic-var* "re-binded var"] *dynamic-var*)) | |
re-binded-var | |
;; -> "re-binded var" | |
*dynamic-var* | |
;; -> "dynamic var" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment