-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Tuples and tuple indexing #3646
Tuples and tuple indexing #3646
Conversation
aa58ded
to
6665d4c
Compare
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.
Super excited to see this in a concrete proposal!
Some quick initial thoughts inline.
To be sure:
Note, I'm not sure how I feel about this; the |
You would need |
Clarify disambiguation rule.
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.
Approving for leads based on our discussion and merging!
- _expression_ `.` _integer-literal_ | ||
- _expression_ `->` _integer-literal_ | ||
|
||
The _expression_ is required to be of tuple type. |
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.
Presumably this only applies to the .
form, and the expression in the ->
form is required to be of type pointer to tuple?
There's a similar problem on line 878.
Improve design changes from #3646 to integrate better into the overall description of member access design.
…3679) Improve the exposition of the design changes from #3646 to integrate better into the overall description of member access design. This fixes the incorrect description of the rules for `->` by instead relying on the general rule that `->` is rewritten to use `*` and `.` before any other processing is done, and generally makes *integer-literal* names be less of a special case.
this changes the tuple index from `tuple[0]` to `tuple.0` in accordance with the accepted propsal carbon-language#3646
this changes the tuple index from `tuple[0]` to `tuple.0` in accordance with the accepted propsal carbon-language#3646
Add support for extracting elements of a tuple by their numerical index.
Also formally add the well-established basic syntactic and semantic rules for
tuples, for which we have had leads issues but no proposal, into the design.