slices
split a list into slices of same size
(list xs, long s) -> list
Partitions xs
into slices. Returns a list of slices, each of size s
. The last slice may contain less than s
items.
Returns an empty list if xs
is empty.
Returns nil
if any argument is nil
.
Throws an error if s <= 0
.
Parameters
Name | Type | Description |
---|---|---|
xs |
list | The list to slice |
s |
long | Size of each slice |