-
Notifications
You must be signed in to change notification settings - Fork 59
lvalues are called places in Rust/MIR #40
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
* *niche* | ||
* *layout* | ||
* *tag* | ||
* *rvalue* | ||
* *lvalue* | ||
* *place* (or *lvalue* in C/C++ speak) | ||
* *rvalue* (maybe we can come up with a Rust term for this as well?) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are called "values of the expression" in C, "prvalue" in C++. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (and we should just call them "values") There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't there a term to distinguish expressions like "3+2" from expressions like "x", where the latter can be used as lvalues but the former cannot? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the latter is a (Rust) place expression, (C) lvalue expression, or (C++) glvalue expression, whereas the former is a (Rust) value expression, (C++) prvalue expression, and C doesn't have a special name for it. In Rust, there's an automatic coercion from value expressions to place expressions in some specific places; and in C++, there's an automatic coercion from prvalue expressions to xvalue expressions (a type of glvalue expression). If you want to convert from a place expression to a value expression it depends on what the kind of the place expression is:
|
||
|
||
## Unsafe abstraction |
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.
These are called "lvalues" in C, and "glvalues" in C++.