-
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
Subscript syntax and semantics #2274
Conversation
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.
Looks good to me! My only concern is making the rewrite depend on whether lhs is an l-value, but I don't have a good alternative to offer instead.
Co-authored-by: josh11b <[email protected]>
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.
Looks good to me.
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 think we may want to tweak or simplify this in the future depending on exactly how R-values work out, but I don't think it's useful to wait for that. Progress > perfection, let's ship this.
Update the design documentation to reflect #2274. The contents are largely copy-pasted from p2274.md with minor edits, but the "Open questions" section is new.
Adds support for subscripting using the conventional square-bracket syntax, with support for both array-like and slice-like semantics.
Cloned from #1356, which was cloned from #1059