Slide - what does withPartial do?

Piotr Mitana the.mail.of.mi2 at gmail.com
Thu Mar 1 08:31:05 UTC 2018


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 on the result when withPartial is on and 
off.

Is it a bug or I don't understand it correctly?


More information about the Digitalmars-d-learn mailing list