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
a. New Iterator<T> type (possibly builtin).
Downsides
Another (builtin) type with niche applications that beginners still have to learn.
Iterators can yield 1 or 2 items. How will that be implemented in the type signature? Have a separate Iterator2<A, B> type, similar to Go, and be required to duplicate methods from Iterator? Or Iterator<T> and Iterator<(A, B)>
b. Iterators are just lists, but optimized by the compiler when used in for-loops (preferred, but future work). A function can return a list, and if it is created and iterated over using specific operations, the compiler can optimize it.
c. Add generator functions that can yield values to the language
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Iterator<T>type (possibly builtin).Downsides
Iterator2<A, B>type, similar to Go, and be required to duplicate methods fromIterator? OrIterator<T>andIterator<(A, B)>All reactions