You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i.e. that allow you to manually iterate through a list, rather than using for.
While iter probably just needs a custom checker/compiler that calls __iter__(), next needs to be a bit more complicated to handle the failure case - what does next do to handle __hasnext__ returning false? (I.e. we need either an Optional return type, which would be pythonic, or else make next panic and then provide some way for client to call __hasnext__ first...)
The text was updated successfully, but these errors were encountered:
Longer term we should just get rid of __hasnext__ and make __next__ return an option type. However, this requires enums or some other ways to encode sums in the language.
i.e. that allow you to manually iterate through a list, rather than using
for
.While
iter
probably just needs a custom checker/compiler that calls__iter__()
,next
needs to be a bit more complicated to handle the failure case - what doesnext
do to handle__hasnext__
returning false? (I.e. we need either anOptional
return type, which would be pythonic, or else makenext
panic and then provide some way for client to call__hasnext__
first...)The text was updated successfully, but these errors were encountered: