> I don't think Vars are thread-local. They're one of the shared > mutable state primitives. They can be defacto thread local if only > used by a single thread but you need a "sufficiently smart compiler" > to notice that.
"Vars provide a mechanism to refer to a mutable storage location that can be dynamically rebound (to a new storage location) on a per-thread basis." That is, bindings are thread-local. set! modifies only the current thread's binding. There is a root binding which is intended to be immutable: "Currently, it is an error to attempt to set the root binding of a var using set!, i.e. var assignments are thread-local." From <http://clojure.org/vars> All of this broadly means that the scope of a particular var can be determined for a given thread's execution. That's not true of a ref, for example. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---