Name

partition-all

Usage

builtin-function

Syntax

(partition-all size step seq)
(partition-all size seq)
(partition-all size)

Description

Divides seq into subsequences of length size. Default step equals size. The last subsequence may contain less elements. The third form returns a transducer.

user > (partition-all 3 (series 10))
it: ((1 2 3) (4 5 6) (7 8 9) (10))
user > (partition-all 3 2 (series 10))
it: ((1 2 3) (3 4 5) (5 6 7) (7 8 9) (9 10))
user > (partition-all 3 4 (series 10))
it: ((1 2 3) (5 6 7) (9 10))