Name

partition-by

Usage

builtin-function

Syntax

(partition-by key seq)
(partition-by key)

Description

Returns a list of subsequences of seq. A new subsequence is started every time the function key has a different value for two adjacent elements of seq. The second form returns a transducer.

user 1 > (partition-by odd? '(1 2 3 3 4 2 5 6 6))
it: (#v(1) #v(2) #v(3 3) #v(4 2) #v(5) #v(6 6))