Re: Map a list of agents to a list of their values

2009-11-15 Thread John Harrop
On Sat, Nov 14, 2009 at 6:03 PM, Meikel Brandmeyer wrote: > Hi, > > Am 14.11.2009 um 20:31 schrieb John Harrop: > > > For situations like this, I find it handy to discover what reader-macros >> are expanding to. This works well: >> >> user=>(defmacro expand [arg] (println arg)) >> #'user/expand

Re: Map a list of agents to a list of their values

2009-11-15 Thread Meikel Brandmeyer
Hi, Am 14.11.2009 um 20:31 schrieb John Harrop: For situations like this, I find it handy to discover what reader- macros are expanding to. This works well: user=>(defmacro expand [arg] (println arg)) #'user/expand user=>(expand #(@%)) (fn* [p1__6536] ((clojure.core/deref p1__6536))) user=>

Re: Map a list of agents to a list of their values

2009-11-14 Thread John Harrop
On Sat, Nov 14, 2009 at 3:24 PM, John Harrop wrote: > On Sat, Nov 14, 2009 at 2:51 PM, Kevin Q wrote: > >> Hi, >> Thanks for the hint. I tried (map deref agents) and it did work. I >> don't know if this is a bug? > > > Nah, it's just being really sneaky. > > >> > (fn* [p1__6536] ((clojure.core/

Re: Map a list of agents to a list of their values

2009-11-14 Thread John Harrop
On Sat, Nov 14, 2009 at 2:51 PM, Kevin Q wrote: > Hi, > Thanks for the hint. I tried (map deref agents) and it did work. I > don't know if this is a bug? Nah, it's just being really sneaky. > > (fn* [p1__6536] ((clojure.core/deref p1__6536))) > Even I didn't notice it before. There's an extr

Re: Map a list of agents to a list of their values

2009-11-14 Thread Kevin Q
Hi, Thanks for the hint. I tried (map deref agents) and it did work. I don't know if this is a bug? On Nov 14, 2:31 pm, John Harrop wrote: > On Sat, Nov 14, 2009 at 12:49 PM, Kevin Q wrote: > > I have a list of agents, each of which has a hasmap state. I want to > > get a list of values from the

Re: Map a list of agents to a list of their values

2009-11-14 Thread Kevin Q
Thanks! That works. However, why wouldn't (map #(@%) agents) work? On Nov 14, 1:01 pm, Sean Devlin wrote: > Try > > (map deref agents) > > On Nov 14, 12:49 pm, Kevin Q wrote: > > > I have a list of agents, each of which has a hasmap state. I want to > > get a list of values from the list of agen

Re: Map a list of agents to a list of their values

2009-11-14 Thread John Harrop
On Sat, Nov 14, 2009 at 12:49 PM, Kevin Q wrote: > I have a list of agents, each of which has a hasmap state. I want to > get a list of values from the list of agents, naturally I used the map > function and print the result of the map: > > (println > (map #(@%) agents)) > > However, when I run

Re: Map a list of agents to a list of their values

2009-11-14 Thread Sean Devlin
Try (map deref agents) On Nov 14, 12:49 pm, Kevin Q wrote: > I have a list of agents, each of which has a hasmap state. I want to > get a list of values from the list of agents, naturally I used the map > function and print the result of the map: > > (println >   (map #(@%) agents)) > > However,

Map a list of agents to a list of their values

2009-11-14 Thread Kevin Q
I have a list of agents, each of which has a hasmap state. I want to get a list of values from the list of agents, naturally I used the map function and print the result of the map: (println (map #(@%) agents)) However, when I run this, I got error "Wrong number of args passed to: PersistentHas