-
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
Design overview update part 7: values #1378
Conversation
@@ -1517,6 +1588,85 @@ type, use `UnsafeDelete`. | |||
> - Proposal | |||
> [#1154: Destructors](https:/carbon-language/carbon-lang/pull/1154) | |||
|
|||
#### `const` |
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.
Unless I've missed something, this hasn't been through the proposal process, and this is a pretty contested and uncertain area, so it might be better to be clear that we don't have a design for this yet.
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.
Added a disclaimer.
Co-authored-by: Geoff Romer <[email protected]>
Every value has a | ||
[value category](<https://en.wikipedia.org/wiki/Value_(computer_science)#lrvalue>), | ||
similar to [C++](https://en.cppreference.com/w/cpp/language/value_category), | ||
that is either _l-value_ or _r-value_. Carbon will automatically convert an |
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.
"Ivalue" and "rvalue" are usually spelled without a hyphen (https://trends.google.com/trends/explore?geo=US&q=lvalue,l-value,rvalue,r-value). If this is a conscious deviation from that, I don't mind it, but just wanted to make sure we weren't deviating by accident :)
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.
FWIW, I find the hyphen to help me with readability quite a bit.
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 the hyphen was what I learned and what was in wikipedia. I saw lvalue in the C++ docs I saw, so I suspect the C++ community might skip the hyphen. I'm happy to switch it if there is agreement, it is not that important to me one way or the other.
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 overall quite nice. Minor comments inline.
Every value has a | ||
[value category](<https://en.wikipedia.org/wiki/Value_(computer_science)#lrvalue>), | ||
similar to [C++](https://en.cppreference.com/w/cpp/language/value_category), | ||
that is either _l-value_ or _r-value_. Carbon will automatically convert an |
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.
FWIW, I find the hyphen to help me with readability quite a bit.
Co-authored-by: Richard Smith <[email protected]> Co-authored-by: Chandler Carruth <[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.
LGTM
This follows #1274 , #1325 , #1328 , #1336 , #1347 , and #1368 . This fills in details about how values work, value categories, parameter passing, unformed state, and so on.