Hi, Am 11.02.2009 um 23:59 schrieb wubbie:
In some post Rich recommended: (let [z (ref 0)] (defn add2 [] (dosync (alter z #(inc %)))))
Just a sidenote: You don't need #(inc %). inc alone is perfectly sufficient. (let [z (ref 0)] (defn add2 [] (dosync (alter z inc))))
Then Is there any way not to deref again for this? It's from ants.clj (alter oldp assoc :pher (inc (:pher @oldp)))
You might use update-in: (alter oldp update-in [:pher] inc) Sincerely Meikel
smime.p7s
Description: S/MIME cryptographic signature