Created
April 29, 2010 10:21
-
-
Save bbatsov/383420 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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