Affects Version/s: None
Fix Version/s: None
Any interest in introducing a partition fn that sits somewhere between partition-by and split-with?
"Applies f to each value in coll, splitting it each time f returns truthy
Returns a lazy seq of partitions."
(when-let [s (seq coll)]
(let [run (cons (first s) (take-while (complement f) (next s)))]
(cons run (partition-with f (seq (drop (count run) s))))))))
(partition-with #(= (rem % 3) 0) [1 2 3 6 7 8 9 12 13 15 16 17 18])
=> ((1 2) (3) (6 7 8) (9) (12 13) (15 16 17) (18))
I've used this occasionally and I notice it popped up on StackOverflow recently.
Not included thus far: the transducer arity or tests, but I'm happy to supply a patch if you're interested.