-
-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Iter.{skip,take,nth} to check '.has_next()' of their inner iterator #2377
Conversation
packages/itertools/_test.pony
Outdated
fun ref has_next(): Bool => false | ||
fun ref next(): U64^ => counter = counter + 1 | ||
end | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The )
should be after the end
keyword, like end)
, rather than on a new line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my bad. this is fixed.
I want to hold on triggering a release until we are ready over at Wallaroo Labs. I'm working towards having our releases not be tied to ponyc's but I need one release that is coordinated first to do that. |
@SeanTAllen - can we go ahead and merge this to get the fix on master, have this merge trigger the creation of a new release issue ticket, and move discussion into that ticket of waiting to actually do the release? |
I am fine either way. I just wanted to state that this would usually trigger a release. |
@jemc yes |
Before this change
Iter.take
would continue iterating untiln
elements were taken or a call tonext()
of the inner iterator would error.has_next()
has never been called.The same is true for
Iter.nth
andIter.skip
.While this works e.g. on Iterators over
Array
(i.e.ArrayValues
) it does not for Iterators that continue returning elements innext()
althoughhas_next()
already returnedfalse
(e.g.collections.Range
).