Last active
August 29, 2015 14:19
-
-
Save davidrupp/1ae6fa19a9ea5bae7b50 to your computer and use it in GitHub Desktop.
alter-var-root-constantly-4
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 thing 1) | |
(alter-var-root #'thing (fn [old-val] nil)) ; value of thing is now nil | |
; we don't really need to name the argument, because we don't use it | |
; but we *do* need to include it; otherwise we'll get an arity exception | |
(alter-var-root #'thing (fn [_] nil)) ; value of thing is now nil | |
; equivalently (kind of) ... | |
(alter-var-root #'thing (constantly nil)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment