Is it safe to alter an atom while iterating that atom's value? It seems to work as I would expect, but am I just getting lucky (and are there concurrency issues)?

user=> (let [a (atom #{1 2 3 4 5})]
         (doseq [x @a] (prn @a) (swap! a disj x)))
#{1 2 3 4 5}
#{2 3 4 5}
#{3 4 5}
#{4 5}
#{5}
nil


--
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