On Thu, Jul 21, 2011 at 10:58 PM, nil <ache...@gmail.com> wrote: > Oh good -- take-while will stop right when it encounters the first > item it can't take?
Yes. (filter even? [some-numbers]) will produce the even numbers from some-numbers and skip the odd ones; (take-while even? [some-numbers]) will produce the even numbers from some-numbers until the first odd number, and then stop. Even numbers after the first odd number won't be produced, and unless something is badly broken it will not grind away forever even if [some-numbers] is replaced by an infinite seq, as long as it isn't an infinite seq of only even numbers. -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true hacker. Not as clumsy or random as C++; a language for a more civilized age. -- 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 first post. 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