https://github.com/flatland/useful/blob/develop/src/useful/seq.clj#L189 is a more general version of partition-by, which can easily handle your requirements.
On May 10, 2:11 pm, Ant <ant...@gmail.com> wrote: > Hi all, > > I am battering my head against the following problem which I'm sure is > straightforward if only I knew how. I want to partition the following > list: > > '("aa123" "x" "y" "z" "bb123" "ccq23" "3" "yg") > > into the following: > > (("aa123" "x" "y" "z") ("bb123") ("ccq23" "3" "yg")) > > The predicate is: > > #(re-matches #"^(\w)\1.*" %) > > partition-by doesn't work, since it splits the sequence when the > result of applying the predicate changes. I want to partition when the > predicate becomes a particular value. > > Any clues on how to accomplish this would be gratefully received! > > Thanks, > > Anthony. -- 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