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

Design overview update part 7: values #1378

Merged
merged 23 commits into from
Jul 15, 2022
Merged

Conversation

josh11b
Copy link
Contributor

@josh11b josh11b commented Jul 11, 2022

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.

@josh11b josh11b requested review from a team as code owners July 11, 2022 22:13
docs/design/README.md Outdated Show resolved Hide resolved
docs/design/README.md Outdated Show resolved Hide resolved
docs/design/README.md Outdated Show resolved Hide resolved
docs/design/README.md Outdated Show resolved Hide resolved
@@ -1517,6 +1588,85 @@ type, use `UnsafeDelete`.
> - Proposal
> [#1154: Destructors](https:/carbon-language/carbon-lang/pull/1154)

#### `const`
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a disclaimer.

docs/design/README.md Outdated Show resolved Hide resolved
docs/design/README.md Outdated Show resolved Hide resolved
docs/design/README.md Outdated Show resolved Hide resolved
docs/design/README.md Outdated Show resolved Hide resolved
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
Copy link
Contributor

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 :)

Copy link
Contributor

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.

Copy link
Contributor Author

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.

docs/design/README.md Outdated Show resolved Hide resolved
docs/design/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@chandlerc chandlerc left a 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
Copy link
Contributor

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.

docs/design/README.md Show resolved Hide resolved
docs/design/README.md Outdated Show resolved Hide resolved
josh11b and others added 2 commits July 14, 2022 21:41
Co-authored-by: Richard Smith <[email protected]>
Co-authored-by: Chandler Carruth <[email protected]>
Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@josh11b josh11b merged commit 53053e5 into carbon-language:trunk Jul 15, 2022
@josh11b josh11b deleted the values branch July 15, 2022 21:42
@chandlerc chandlerc added the documentation An issue or proposed change to our documentation label Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation An issue or proposed change to our documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants