Module ddash.range.chunk
Creates a range consisting of chunks of another range
Differences between
0
as a valid chunk size
Example
assert([1, 2, 3] .chunk(0) .equal((int[][]) .init));
assert([1, 2, 3] .chunk(1) .equal([[1], [2], [3]]));
Functions
Name | Description |
---|---|
chunk(range, size)
|
Creates a range of ranges of length size . If the range can't be split evenly,
the final chunk ` will be the remaining elements.
|