Re: Threads and Functions Question

2008-09-09 Thread noahr
The binding trick seems to work. I had already tried using (in-ns) before, but didn't realize about needing the binding, so got a nasty error of course. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group.

Threads and Functions Question

2008-09-08 Thread noahr
I've hit another mystery (to me), that I hope someone can explain. Why doesn't the following work? (defn tst[] (pr 4)) (defn trd[] (let [f #(eval '(tst))] (. (Thread. f) start) )) It seems that a separate thread can not EVAL any defined functions. If I change the above to remove the

Re: Threads and Functions Question

2008-09-08 Thread Meikel Brandmeyer
Hello, Am 08.09.2008 um 20:37 schrieb noahr: (defn tst[] (pr 4)) (defn trd[] (let [f #(eval '(tst))] (. (Thread. f) start) )) The eval executes the code in the clojure namespace. You have to fully qualify your tst function. The easiest way to do this to use ` instead of '. So using `