Skip to content

Instantly share code, notes, and snippets.

@bbatsov bbatsov/*scratch*
Created Apr 29, 2010

Embed
What would you like to do?
(defn loves [x y]
(str x " loves " y))
(defn test-rebind []
(println (loves "ricky" "lucy"))
(let [str-orig str]
(binding [str (fn [& args]
(println "Logging str")
(apply str-orig args))]
(println (loves "fred" "ethel")))))
(test-rebind)
ricky loves lucy
Logging str
Logging str
Logging str
Logging str
Logging str
fred loves ethel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.