Skip to content

Instantly share code, notes, and snippets.

@devth
Last active December 28, 2015 19:45
Show Gist options
  • Save devth/24c930ed95b8f7100664 to your computer and use it in GitHub Desktop.
Save devth/24c930ed95b8f7100664 to your computer and use it in GitHub Desktop.
(def ^:dynamic *foo*)
(defprotocol A
(t [_]))
(defrecord AA []
A
(t [_] *foo*))
(t (->AA)) ; Unbound as expected
(binding [*foo* 1]
(t (->AA))) ; 1
(defn make-a []
(binding [*foo* 2]
(->AA)))
(t (make-a)) ; Unbound: sad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment