On Tue, Mar 16, 2010 at 5:25 AM, Christophe Grand <christo...@cgrand.net> wrote:
> On Mon, Mar 15, 2010 at 11:27 PM, Chouser <chou...@gmail.com> wrote:
>>
>> I make no claims about the Rightness of this suggestion, but
>> simply offer another example of a work-around:
>>
>>    (dosync (alter r identity) (alter r f))
>>
>> That is, a "dummy write" via alter is also sufficient to allow
>> the transaction to succeed, just like 'ensure'.
>
> This is an interesting idea which can be automated (well, to be frank, an
> implicit ensure could also be automated but it doesn't feel kosher) by
> adding a doAlter to c.l.LockingTransaction:

Well, what you've got there seems much cleaner than a dummy
write, and makes 'alter' do a lot less work than it did.  I won't
pretend to understand the STM well enough to know if it's all
correct though.

--Chouser
http://joyofclojure.com/

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