Skip to content

Instantly share code, notes, and snippets.

@dgrnbrg
Created January 25, 2012 05:00
Show Gist options
  • Save dgrnbrg/1674825 to your computer and use it in GitHub Desktop.
Save dgrnbrg/1674825 to your computer and use it in GitHub Desktop.
(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