Created
January 25, 2012 05:00
-
-
Save dgrnbrg/1674825 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 foo 0) | |
(def my-bound-fn | |
(binding [foo 22] | |
(bound-fn [name] | |
(println "Hi" name "foo is" foo))) | |
(assert (= foo 0)) | |
(my-bound-fn "David") | |
(assert (= foo 0)) | |
;Prints "Hi David foo is 22" but called outside the binding! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment