On Thu, Sep 17, 2009 at 2:49 PM, Stuart Sierra
<the.stuart.sie...@gmail.com> wrote:
>
> On Sep 17, 12:40 pm, Gorsal <s...@tewebs.com> wrote:
>> Oh. And just as a quick other question, do global bindings affect
>> threads which are started in the same ns?
>
> I think threads inherit the bindings in effect when they are created.

They do not, or this would print "out: nil":

user=> (binding [*out* nil] (.start (Thread. #(println "out:" *out*)))
(Thread/sleep 100))
out: #<OutputStreamWriter java.io.outputstreamwri...@317cfd38>
nil

In a new thread, vars always start with their root binding.

There's an ongoing discussion about the best way to provide
other options when this is not the desired behavior:

http://www.assembla.com/spaces/clojure/tickets/170-bound-fn-macro

--Chouser

--~--~---------~--~----~------------~-------~--~----~
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
Note that posts from new members are moderated - please be patient with your 
first post.
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