Re: ref strange behavior

2016-08-23 Thread Sergei Koledov
lojure's reference >> types inside other reference types. They should store persistent data >> structures to really make any sense in a concurrent context. >> >> On Tuesday, August 23, 2016 at 8:22:00 AM UTC-4, Sergei Koledov wrote: >> >>> Hello, >

Re: ref strange behavior

2016-08-23 Thread Sergei Koledov
an...@mail.yu.edu > wrote: >> >> I haven't run your code yet, but it's bad form to use Clojure's reference >> types inside other reference types. They should store persistent data >> structures to really make any sense in a concurrent context. >

Re: ref strange behavior

2016-08-23 Thread Sergei Koledov
t of time, so I'd > suggest running it with 1e5 as that will finish much quicker. > > > > On Tuesday, August 23, 2016 at 8:22:00 AM UTC-4, Sergei Koledov wrote: >> >> Hello, >> >> I had a problem when I run the following code: >> >> (

ref strange behavior

2016-08-23 Thread Sergei Koledov
Hello, I had a problem when I run the following code: (defn get-task [tasks] (dosync (let [task (first @tasks)] (alter tasks rest) task))) (defn worker [& {:keys [tasks]}] (agent {:tasks tasks})) (defn worker-loop [{:keys [tasks] :as state}] (loop [last-task nil] (if-l