Skip to content

Instantly share code, notes, and snippets.

@AlexBaranosky
Created February 19, 2014 02:48
Show Gist options
  • Save AlexBaranosky/9085169 to your computer and use it in GitHub Desktop.
Save AlexBaranosky/9085169 to your computer and use it in GitHub Desktop.
How to make a var dynamic at runtime
;; 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