Hi,
This example is from clojure site.
My question is on line 5 and line 6:
The confusion is str is a function and here looks like used as a
regular variable.
Thanks in advance.
Sun
(defn loves [x y]
(str x " loves " y))
(defn test-rebind []
(println (loves "ricky" "lucy"))
(let [str-orig str] ---> line 5:
(binding [str (fn [& args] --> line 6:
(println "Logging str")
(apply str-orig args))] -->line 8:
(println (loves "fred" "ethel")))))
(test-rebind)
ricky loves lucy
Logging str
Logging str
Logging str
Logging str
Logging str
fred loves ethel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---