Re: Slide - what does withPartial do?

2018-03-01 Thread Seb via Digitalmars-d-learn
On Thursday, 1 March 2018 at 08:31:05 UTC, Piotr Mitana wrote: For some reason this is true: slide!(Yes.withPartial)([1, 2, 3, 4, 5], 3).array == [[1, 2, 3], [2, 3, 4], [3, 4, 5]] Shouldn't it rather return [[1], [1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5], [5]], or at least [[1, 2, 3],

Re: Slide - what does withPartial do?

2018-03-01 Thread Simen Kjærås via Digitalmars-d-learn
On Thursday, 1 March 2018 at 08:31:05 UTC, Piotr Mitana wrote: For some reason this is true: slide!(Yes.withPartial)([1, 2, 3, 4, 5], 3).array == [[1, 2, 3], [2, 3, 4], [3, 4, 5]] Shouldn't it rather return [[1], [1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5], [5]], or at least [[1, 2, 3],

Slide - what does withPartial do?

2018-03-01 Thread Piotr Mitana via Digitalmars-d-learn
For some reason this is true: slide!(Yes.withPartial)([1, 2, 3, 4, 5], 3).array == [[1, 2, 3], [2, 3, 4], [3, 4, 5]] Shouldn't it rather return [[1], [1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5], [5]], or at least [[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5], [5]]? I can see no difference