Why visible in-transaction changes?

2011-09-23 Thread Denis Washington
Hi, I really like the idea of grouping mutation in my programs into transactions in order to reduce the number of possible states make make reasoning about them easier (in the spirit of the mutable state discussion of [1]) and thought that Clojure's dosync + refs might be the ideal way to do

Re: Why visible in-transaction changes?

2011-09-23 Thread Stuart Halloway
I would have hoped that changes to refs during an transaction wouldn't affect the in-transaction value of the ref (that is, I would have liked the code to print 1, then 2). This way, the view of the program's state would always be guaranteed to be consistent, even during a transaction, and

Re: Why visible in-transaction changes?

2011-09-23 Thread Denis Washington
Am 23.09.2011 17:25, schrieb Stuart Halloway: I would have hoped that changes to refs during an transaction wouldn't affect the in-transaction value of the ref (that is, I would have liked the code to print 1, then 2). This way, the view of the program's state would always be guaranteed to be

Re: Why visible in-transaction changes?

2011-09-23 Thread Stefan Kamphausen
Hi, On Friday, September 23, 2011 5:25:34 PM UTC+2, stuart@gmail.com wrote: I would have hoped that changes to refs during an transaction wouldn't affect the in-transaction value of the ref you usually don't want that. When you start working on more than one value in a transaction (and