Re: STM with deeper structure

2010-02-20 Thread Mike Meyer
On Sat, 20 Feb 2010 17:27:34 -0800 (PST) "sailormoo...@gmail.com" wrote: > Hi : > > Say, I have a (def *a (ref {:b [{:c 5}]})) . > I want to add 1 to the :c inside, how would I write? > (Note: the value 5 is in (:b 0 :c), while 0 is the array index) > > (dosync (alter *a __ )) ; ple

STM with deeper structure

2010-02-20 Thread sailormoo...@gmail.com
Hi : Say, I have a (def *a (ref {:b [{:c 5}]})) . I want to add 1 to the :c inside, how would I write? (Note: the value 5 is in (:b 0 :c), while 0 is the array index) (dosync (alter *a __ )) ; please help me fill the blank. Someone mention I can use the zipper library or the walker