Module ddash.range.chunk

Creates a range consisting of chunks of another range

Differences between

  • phobos.std.range.chunk - treats 0 as a valid chunk size
  • lodash.chunks - none intended

  • Example

    assert([1, 2, 3].chunk(0).equal((int[][]).init));
    assert([1, 2, 3].chunk(1).equal([[1], [2], [3]]));
    

    Functions

    NameDescription
    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.