-
Notifications
You must be signed in to change notification settings - Fork 100
Add toIter
method to List
#336
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
Conversation
Thanks for this contribution @hoosan! In the review above, I see that @ggreif raised the issue of naming this function. To be consistent with the guidelines for FWIW, I think Despite the guidelines saying otherwise, I also tend to think of |
Yeah, I'm fine with I'd actually suggest replacing the (I guess the argument for calling it Thanks for the contribution! |
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.
If you don't mind, please also re-implement Iter.fromList directly using List.toIter.
Thank you @matthewhammer and @crusso for your kind reviews. I replaced the implementation of |
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.
Thanks @hoosan!
In this PR, I have added a method
toIter
toList.mo
to convertList
toIter
.The first reason for this addition is that it is intuitive to have the conversion method defined in the class/module from which it is converted, in association with for example Rust's
array.into_iter()
.The second reason is that the current library requires the conversion from
List
toIter
usingIter.fromList()
, so there are situations where an extraimport Iter "mo:base/Iter";
is needed just for the conversion.Thank you for your consideration.