Skip to content

clojure.core/partition

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 9 Runnable: 6
([n coll] [n step coll] [n step pad coll])

Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complete last partition upto n items. In case there are not enough padding elements, return a partition with less than n items.

Examples

by nipra on
by uvtc on
by Parijat Mishra on
by porglezomp on
by luciancrasovan on
by phreed on . May have evaluation errors.
by anpr on
by malloryerik on . May have evaluation errors.
by tomdl89 on . May have evaluation errors.

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.