-
Notifications
You must be signed in to change notification settings - Fork 59
lvalue and rvalue should be documented as well #30
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
Conversation
Please, let's call them "place" and... "operand" or "value" or so. We probably have to mention "lvalue" in the description of "place" because it is used in C/C++, but it is not a great name. |
I think whatever the canonical Rust name becomes, you will want these two documented, even if only as redirects to the proper name. Documenting what they are and picking a name for them can be orthogonal. |
We explicitly removed |
At least I was not talking about expressions though, but about the "thing" they evaluate to. I guess it would be consistent then to say that place expressions evaluate to a place, and value expressions evaluate to a value. |
Another important thing is that place expressions can also evaluate to a value, and value expressions can evaluate to a place, if necessary. First, it's important to note that there are 2 axes on which places can be put - the immutable/mutable axis, the owned/borrowed axis, and the initialized axis (ignored for this comment). Place-to-value conversion is allowed when, given a place expression
Value-to-place conversion is allowed for all values (afaik), and results in a mutable, owned place expression. |
To be clear, this is just a request that these terms be documented, just like the existing requests for terms. It seems like all of the discussion y'all are having will be lost / not-easily findable when this PR is merged. Perhaps it's appropriate to move that discussion into an issue? |
we can also just have something like
|
@avadacatavra yeah, the term across the languages is lvalue (C), place (Rust), and glvalue (C++). Basically, it means an expression that refers to a location, as opposed to just a value: fn main() {
0; // value expression - 0 is not a place
let x = 0;
x; // place expression - x is a place
} |
i'd be fine if we wanted to add that to this PR 💯 |
I'm going to merge this and we can define at some point in time |
No description provided.