Re: Loop, Recur, and Binding

2009-07-18 Thread Meikel Brandmeyer
Hi Tim, the issue is already in the tracker: http://www.assembla.com/spaces/clojure/tickets/31 Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature

Re: Loop, Recur, and Binding

2009-07-18 Thread Stuart Sierra
Hi, Tim, I'm not 100% certain what is going on here, but I do know that, in general, binding and loop/recur should not be mixed. "recur" is not true recursion -- it's more like a GOTO. The "binding" macro establishes thread-local bindings using the static methods clojure.lang.Var/pushThreadBind

Loop, Recur, and Binding

2009-07-17 Thread Tim Snyder
I was experimenting with how binding behaves within a loop and found some inconsistent results: (def y 0) (loop [x 0] (println "x " x) (binding [y (inc y)] (println "y " y) (if (< x 10) (recur (inc x) The printed lines are what you'd expect: x 0 y 1 x 1 ... x 10 y 11 But if