Skip to content
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

[spec/statement.dd] Improve 'Foreach over Structs & Classes with Ranges' #3204

Merged
merged 2 commits into from Feb 1, 2022

Conversation

ntrel
Copy link
Contributor

@ntrel ntrel commented Feb 1, 2022

Link to std.range.
Add example using linked list.

Add 'Multiple Element Values' subheading.
Fix tuple -> sequence typo.
Fix tuple front example to not infinite loop & make runnable. Show single foreach variable is still legal.
Link to Tuple.

Link to std.range.
Add example using linked list.

Add 'Multiple Element Values' subheading.
Fix tuple -> sequence typo.
Fix tuple front example to not infinite loop & make runnable.
Show single variable is still legal.
@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @ntrel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Copy link
Contributor

@dkorpel dkorpel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually I would like to see an example that doesn't depend on Phobos tuples, since I found it pretty hard to figure out how to get multiple foreach variables on my own types.

@ntrel
Copy link
Contributor Author

ntrel commented Feb 1, 2022

@dkorpel Thanks for reviewing (and the other PRs). I've updated this to define Tuple in the example instead of using std.typecons.

@maxhaton maxhaton merged commit 0ad20e7 into dlang:master Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants