Skip to content

doc: add range iterators in the for loop section #8682

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

Closed
wants to merge 1 commit into from

Conversation

adrientetar
Copy link
Contributor

No description provided.

@brendanzab
Copy link
Member

Is there any reason you decided to put it above the part about for being sugar? Because that applies to range as well. I'm also not convinced that range_inclusive needs to be mentioned.

@adrientetar
Copy link
Contributor Author

  1. The way I see it, the point of saying that for is sugar here is precisely to point out that it can go through any array as iterator which isn't common on today's most used programming languages (afaik).
  2. I like to use it for semantic purposes (eq. to >= or <= operators in C). A good compromise would be removing the example but still mentioning it in the parenthesis (through the example shows that it has to be imported, useful for the newbie willing to get started fast).

@huonw
Copy link
Member

huonw commented Aug 22, 2013

@thestinger

@thestinger
Copy link
Contributor

I think it would make more sense to mention range, range_inclusive, count and unfoldr in a separate section, after the for loop one. I'm okay with this landing as is though, I'll just play with it a bit later.

bors added a commit that referenced this pull request Aug 23, 2013
@bors bors closed this Aug 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants