-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Guide: iterators #16408
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
Guide: iterators #16408
Conversation
src/doc/guide.md
Outdated
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.
s/an/can/
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.
thank you!
|
Nicely written. I expected to learn two more things though:
(Correct me if this is wrong.) |
|
@killercup great point on the lazy, but we haven't actually introduced traits yet, so we can't talk about that. Implementing iterators is out of the scope of this guide, but should certainly go in the broader iterator documentation. |
|
Okay. New draft up. This is significantly different, but addresses all of the problems with the last one. What do we think? |
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.
Is the int in Some(int) meant to be the type or meant to be a name binding?
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 type.
|
I like it! |
src/doc/guide.md
Outdated
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.
Missing ). Also, looking at it written down, maybe it could be just fold(base, |accumulator, element| ...).
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.
agreed.
src/doc/guide.md
Outdated
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.
To be precise, they're not always new as it repeats after 264 (or 232) elements.
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.
I added a sentence here. Once we address #15526 , I'll make it more specific.
An introduction to iterators. I kinda like this, but I kinda don't. Hmmm.
An introduction to iterators. I kinda like this, but I kinda don't. Hmmm.