Skip to content

Instantly share code, notes, and snippets.

@dgrnbrg
Created January 25, 2012 04:38
Show Gist options
  • Save dgrnbrg/1674758 to your computer and use it in GitHub Desktop.
Save dgrnbrg/1674758 to your computer and use it in GitHub Desktop.
(def ^:dynamic foo 0)
((binding [foo 22]
(bound-fn [name]
(println "Hi" name "foo is" foo))) "David")
(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