ngs icon indicating copy to clipboard operation
ngs copied to clipboard

Implement limit(Iter, Int)

Open ilyash-b opened this issue 6 years ago • 5 comments

ilyash-b avatar Sep 11 '18 06:09 ilyash-b

Could you elaborate more on this?

antonio-pedro99 avatar Oct 05 '22 18:10 antonio-pedro99

I am on it

antonio-pedro99 avatar Oct 05 '22 18:10 antonio-pedro99

Implement in Iter. Should return new object, a subtype of Iter, probably LimitIter (a new type), which would give a maximum of n (the Int from the constructor) elements.

ilyash-b avatar Oct 08 '22 09:10 ilyash-b

what is good test case for it? limit([3, 4, 5, 10].Iter(), 2).Arr() == [5, 10] or imit([3, 4, 5, 10].Iter(), 2).Arr() == [3, 4]

antonio-pedro99 avatar Oct 14 '22 12:10 antonio-pedro99

what is good test case for it? limit([3, 4, 5, 10].Iter(), 2).Arr() == [5, 10] or imit([3, 4, 5, 10].Iter(), 2).Arr() == [3, 4]

[3, 4] - must return the elements from the start

ilyash-b avatar Oct 14 '22 15:10 ilyash-b