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

Records Primary Deconstructor? #1204

Closed
ghost opened this issue Dec 20, 2017 · 2 comments
Closed

Records Primary Deconstructor? #1204

ghost opened this issue Dec 20, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Dec 20, 2017

in csharplang/proposals/records.md
will the record have a Primary Deconstructor (a default Destruct method with the same field order?)
Also: I suggest to add a method named ToTuple to convert the record to a tuple. It will be nice also to create a record based on a tuple.

@DavidArno
Copy link

That's probably a question for @gafter, who is likely to reply "maybe" to the first question. As far as I know, the design for records is still very much "up in the air" still.

@gafter
Copy link
Member

gafter commented Dec 21, 2017

@MohammadHamdyGhanem When the records proposal is revised, the operator is part will be replaced by a similar thing based on Deconstruct. The name has changed, but the behavior will be similar.

I'm not sure I understand the value in the proposed record-tuple conversion. Please open a new issue with your proposal, with an explanation of the benefits and examples.

@gafter gafter closed this as completed Dec 21, 2017
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

No branches or pull requests

2 participants