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 clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to