Namespaces
Variants
Actions

Talk:c/language/value category

From cppreference.com

[edit] value category

The term "value category" does not appear in the standard, nor does its definition appear on this page; so, I inserted a link to its definition on the "Expressions" page. The term "primary categories" does not appear as a term in the standard, but I believe that "value category" is meant; so, I replaced "primary" with "value" to achieve a little more cohesion in the usage of this term. Newatthis (talk) 06:05, 5 April 2016 (PDT)

this is the page that provides the definition of value category. Expressions#General links here (it provides navigation). --Cubbi (talk) 06:52, 5 April 2016 (PDT)

[edit] Non-lvalue object expressions

This header includes the word "object," yet the text under the header uses the phrase "non-lvalue expressions" three times. Should the header exclude the word "object?" In other words, are there two separate things: non-lvalue object expressions and non-lvalue expressions? Newatthis (talk) 07:56, 5 April 2016 (PDT)

I'd rather have it say 'rvalues' since that's what everyone call these. The precise standardese is indeed "non-lvalue object expression" because "non-lvalue expression" includes both rvalues and function designators. --Cubbi (talk) 08:26, 5 April 2016 (PDT)
I searched n1570 for the standardese "non-lvalue object expression" and found no occurrence. I searched n1570 for the standardese "non-lvalue expression" and found one occurrence at 6.2.4/8. This difference is why I questioned using the phrase "non-lvalue object expression" on this page. Also, I am confused by "no object identity." If that phrase is a correct characterization, then why use "object" in the header? I am trying to build a case for deleting "object" from the header. Newatthis (talk) 14:36, 5 April 2016 (PDT)
as mentioned, "non-lvalue expression" would include both rvalues (currently under the heading "Non-lvalue object expressions")) and functions (currently under the heading "Function designator expression"), since neither is lvalue. --Cubbi (talk) 14:57, 5 April 2016 (PDT)
Many thanks. I continue rereading his page to understand why there are three value categories and not just two. I read on StackOverflow that function designators are rvalues in C (lvalues in C++). When I read that, I thought two value categories: lvalue, non-lvalue. Also, are the terms "value category" and "object identity" C++ terms that happen to have meaning in C even though they do not appear in n1570? Newatthis (talk) 05:11, 6 April 2016 (PDT)
The C standard is not a computer science encyclopedia, it does not need to provide the definition of every concept required to use it. It has a very specific audience; compiler and library vendors. --Cubbi (talk) 05:55, 6 April 2016 (PDT)

[edit] lvalues

The paragraph 6.5.1/5 mentions that the primary expression parenthesized expression is an lvalue. Should it too be included in the list on this page? Newatthis (talk) 03:16, 11 April 2016 (PDT)