When you increment the contents of an atom, for example, it happens immediately. If it is inside a transaction, and the transaction retries, the contents will be incremented multiple times. Refs, on the other hand, retry from the initial state at the beginning of the transaction, so as long as there are no external side effects, you get the illusion that it only happened once. Essentially, changing an atom is like other side effects (e.g., display or file output), and therefore cannot be safely used inside a transaction.
On Fri, Mar 5, 2010 at 1:08 PM, eyeris <[email protected]> wrote: > I don't follow your logic. Modifications of refs within a transaction > retry too. > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
