On Sun, Nov 28, 2010 at 1:17 PM, Ken Wesson <[email protected]> wrote: > The implementation I posted earlier appears to fit the contract of > your partition-before (and, additionally, works properly if the input > starts with (nil ...) :)).
Good catch :) I should have used (empty? coll) instead of (nil? first-item) to check for emptiness. The implementation you posted earlier (split-when) is quite elegant. However, one thing I noticed about it was that it calls pred multiple times for each item in coll -- it would be nice if this redundancy could be removed somehow. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. 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
