rust-lang / reference

The Rust Reference
https://doc.rust-lang.org/nightly/reference/
Apache License 2.0
1.15k stars 447 forks source link

Rename "Value expressions and place expressions" section to "Expression categories" #972

Open Havvy opened 3 years ago

Havvy commented 3 years ago

C++ calls them value categories. Since we call one "value expression", I'd like to avoid that term and instead call them a category of some kind. Since the distinction is about what kind of thing the expression evaluates to, I figured "evaluation category" would be the best term.

Having this term would also let me say parenthesized expressions are of the same evaluation category as their enclosed operand.

Havvy commented 3 years ago

Nominating with the question that adding this term is correct and that the name is alright.

nikomatsakis commented 3 years ago

Perhaps "categories of expressions" or "expression categories"?

nikomatsakis commented 3 years ago

Evaluation seems strange to me because it sounds very much like a property of what happens when the expression executes, but this is more of a category of expression that can be evaluated to a place in memory in some contexts.

joshtriplett commented 3 years ago

Agreed. We're talking about a name that encompasses "value expression" and "place expression", so "expression category" seems reasonable.