Skip to content

Instantly share code, notes, and snippets.

@bbatsov
Created April 29, 2010 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbatsov/383420 to your computer and use it in GitHub Desktop.
Save bbatsov/383420 to your computer and use it in GitHub Desktop.
(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