thanks Meikel, I'll have a look. Cheers, sun
On Feb 11, 6:09 pm, Meikel Brandmeyer <m...@kotka.de> wrote: > 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 > 5KViewDownload --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---