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
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.
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
___