Re: Understanding map laziness in relation to vectors

2013-03-06 Thread Achint Sandhu
Thank you Dave. Very much appreciated. Cheers, Achint -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your firs

Re: Understanding map laziness in relation to vectors

2013-03-06 Thread Dave Sann
It's to do with the chunking of sequences. they are taken in blocks of 32. So minimum of 32 will be executed. (first (remove nil? (map foo (vec (range 1 1000) Exeuting for... 1 Exeuting for... 2 Exeuting for... 3 Exeuting for... 4 Exeuting for... 5 Exeuting for... 6 Exeuting for... 7 Exeuting

Understanding map laziness in relation to vectors

2013-03-06 Thread Achint Sandhu
Hi, In the sample code below, I'd like to rerun the first value that returns a non-nil result upon the application of a function (foo in the code sample below). In the real use case , the computation of the function is expensive, so I'd only like to run foo until I find the first non-nil value.