> (def a (ref ())) > > (def b (ref ())) > > (dosync > (alter a conj b)) > > (dosync > (alter b conj a)) > > This last expression fails with an "Evalutation aborted" message on > Clojure 1.2.0-master-SNAPSHOT (it works on Clojure 1.1.0). Maybe I am > not using refs correctly, but I did not expect this to fail. Can > anyone explain this?
It seems to work for me on both. Are you perhaps doing this in a REPL (other than the default) or IDE where you are susceptible to stack overflow while the result is auto-printed? I get stack overflows in the REPL in both 1.1 and 1.2 because of the after-eval printing of the result, but the alters do succeed. In other words, *printing* a, @a, b or @b may give you difficulties due to infinite recursion. But is one of the (dosync ...) blocks really failing? -- / Peter Schuller -- 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