Split a sequence by function in Clojure Christoph Frick - ofnir.net 2016-04-18 Split a collection on the sequence of elements, that match it. (defn split-by ([pred] (comp (drop-while pred) (partition-by pred) (take-nth 2))) ([pred coll] (sequence (split-by pred) coll))) ; (split-by zero? [1 0 2 0 3]) => ([1] [2] [3])