seems like a good reason all predicates should be required to return their argument, contractually. So this is a good lesson for me. Even if I'm wrong about all predicates, how would one do such a thing in a functional language? That is, I'm not even sure what "all predicates" means. In OO, it would mean they somehow subclass "predicate" . . . or in static, generic programming, you'd get a compile error it the wrong type were returned from the predicate template param.
Anyway, if all preds don't return their argument, you can't trust any to. ... seems to me. On Tue, Mar 10, 2009 at 8:31 PM, Rob <rob.nikan...@gmail.com> wrote: > > > On Mar 10, 2:45 pm, "gray...@gmail.com" <gray...@gmail.com> wrote: > > Doesn't (some pred coll) do the same thing as (first (filter pred > > coll))? > > Not quite, because ... > > (some even? [1 2 3]) --> true > (first (filter even? [1 2 3])) --> 2 > > `some' only works like that when the "predicate" returns it's argument > instead of true. > > Rob > > > --~--~---------~--~----~------------~-------~--~----~ 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 To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---