-
Notifications
You must be signed in to change notification settings - Fork 84
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
Discards, tuples and out variables #664
Discards, tuples and out variables #664
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.
Submitting the comments as far as I've got. (More reading and thinking to do.)
Make sure evaluation order is described precisely in deconstructing assignments.
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 like this approach. I likely went into details that were beyond where you've already speced things out, but I wanted to make sure I noted them, even if just to extend the TODO list.
This does make a number of concepts more cohesive.
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
…ithub.com/dotnet/csharpstandard into Mads-v7-local-declarations-in-expressions
Current status - the PR is taking shape but the following work is still TODO:
The scope of this PR will not include patterns. |
Re discards, I propose adding the following text to lexical-structure.md, near the end, just before the mention of identifiers starting with
|
Some editorial feedback:
|
The |
…ithub.com/dotnet/csharpstandard into Mads-v7-local-declarations-in-expressions
Agreed we're good to merge this - there are still tiny bits to do, but getting this in and then raising more bits will be better than trying to get it all the way. |
dotnet/csharpstandard#664 added a few new sections which rippled through the TOC.
* Unpublish feature specs These two features are now incorporated into the draft V7 standard. Remove the feature speclets from docs. * build issues * missed a comma * Yet another feature PR was merged Update per new feature PR merged in the standard. * address warnings from standard PR dotnet/csharpstandard#664 added a few new sections which rippled through the TOC. * warnings, take 2
This is a very rough cut of discards, tuples and out variables, and is here for discussion/sharing purposes. It lacks examples and cross references throughout and doesn't touch on patterns at all. It's also missing treatment of additional declaration spaces at statement/expression level, as well as the syntactic short form
var (a, b)
in deconstruction.The intent is to test out an alternative approach to #44, #63 and #596 along the lines suggested in #561, and to fill out several gaps in those PRs.
The approach differs in several ways:
tuples
helps describe when, whether and how tuples should be evaluated.I believe this approach is more correct now, and more resilient to future language additions. But there is still a ways to go to clean it up.