Hi Nicolas, First to answer, but not necessarily the most accurate answer you'll get. Be warned ! :-)
You can nest refs into refs. But in that case, don't mismatch the ref and a particular value of the ref in your mental model. You will be reminded of this in your code because you'll have to deref deref deref ... to get a value. So, a ref in a ref still represents an identity (which is considered immutable), not a particular value of the identity. HTH, -- Laurent 2010/5/4 Nicolas Oury <nicolas.o...@gmail.com>: > Dear all, > > I have a problem where a lot of concurrency could be gained by having > a tree of references. > ie a tree where each nodes contain a ref to a set of similar tree. > > (I know that having mutable trees is asking for troubles, but that is > quite necessary for the things I wish to do.) > > I read that > "The values placed in Refs must be, or be considered, immutable!! > Otherwise, Clojure can't help you." > > I put a lot of hope (and cross fingers) in the "be considered" part of > the sentence :). > > Under which conditions can you use a ref inside a ref? > What happens if you don't? For cultural purpose: what is the canonical > example of a problem? > > Best regards, > > Nicolas. > > -- > 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 -- 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