Re: Trying to define next-agent function

2009-01-14 Thread bOR_
Also a newbie wrestling with agents.. but perhaps you could do something with lazy-cons or cycle? An endless cycle of your agents: (def running true) (while running (doseq [a (cycle agents)] (send-off a somefunction)) On Jan 14, 4:48 pm, Justin Johnson wrote: > I found my problem.  I wasn

Re: Trying to define next-agent function

2009-01-14 Thread Justin Johnson
I found my problem. I wasn't calling agents. I was doing this. => (defn next-agent [] (nth agents (next-counter))) and should have been doing this. => (defn next-agent [] (nth (agents) (next-counter))) Still, I would like feedback. Is there a cleaner way to do this? Thanks. Justin On Wed,

Trying to define next-agent function

2009-01-14 Thread Justin Johnson
Hello, I'm trying to create a list of agents and a function called next-agent that always gives me the next agent and restarts at the beginning when the list is exhausted. For my purposes the agent is serving as a thread that will do some work. I don't much care about its value at this time. I'