Re: confusion with map and dosync

2011-09-14 Thread Matt Hoyt
September 15, 2011 1:01 AM Subject: Re: confusion with map and dosync Map is lazy so it only gets called when you need something from the sequence.   To force it to be called you use doall so it would be (doall (map queue-copy-fetch fetches-seq)). You only need the do sequence in queue-copy-fetc

Re: confusion with map and dosync

2011-09-14 Thread Luc Prefontaine
Map returns a lazy sequence, the list of values is not realized yet, you need to consume the lazy seq to obtain the values. You should use (doseq [f fetches-seq] (queue-copy-fetch f))) if you have only side effects to generate and do not care about reusing the values returned by queue-copy-fetch.

Re: confusion with map and dosync

2011-09-14 Thread Matt Hoyt
Map is lazy so it only gets called when you need something from the sequence.   To force it to be called you use doall so it would be (doall (map queue-copy-fetch fetches-seq)). You only need the do sequence in queue-copy-fetch but not in process-indexes.   Matt Hoyt ___