> but apply works very well for this use case: (apply < (range 10)) > and it stops as soon as it can: Alright, I fold... thanks for clearing things up Christophe!
On Tue, Feb 3, 2009 at 3:13 PM, Christophe Grand <[email protected]>wrote: > > Stu Hood a écrit : > > I still think the > > (< (range 10)) > > ... use case is really worthwhile though, and I don't see a way to > > accomplish it with reduce. > > reduce is not a good fit since you would want to short circuit the > computation at the first false. > but apply works very well for this use case: (apply < (range 10)) > and it stops as soon as it can: > > user=>(apply < (map #(doto % println) (concat (range 10 20) (range 10)))) > 10 > 11 > 12 > 13 > 14 > 15 > 16 > 17 > 18 > 19 > 0 > false > > Christophe > > -- > Professional: http://cgrand.net/ (fr) > On Clojure: http://clj-me.blogspot.com/ (en) > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
