Re: agents returning nil by default

2010-05-20 Thread Daniel Werner
On 20 May 2010 11:42, Anders Rune Jensen anders.rune.jen...@gmail.com wrote: The algorithm: (defn change-state [cur-state]   (when ( (:value cur-state) 10)      (assoc cur-state :message danger, danger))) How I'd have to write it when using an agent: (defn change-state [cur-state]  

Re: agents returning nil by default

2010-05-20 Thread Anders Rune Jensen
On Thu, May 20, 2010 at 2:26 PM, Daniel Werner daniel.d.wer...@googlemail.com wrote: On 20 May 2010 11:42, Anders Rune Jensen anders.rune.jen...@gmail.com wrote: The algorithm: (defn change-state [cur-state]   (when ( (:value cur-state) 10)      (assoc cur-state :message danger, danger)))

agents returning nil by default

2010-05-10 Thread Anders Rune Jensen
Hello I've recently found out just what a good invention agents are. I find them to handle a few idioms I see in other languages very nicely. I started changing some of my code over to it, and it has really helped the structure. But I was a little surprised to find out that by default, if you