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

Upper-case vs Lower-case for expressions #3271

Closed
brevzin opened this issue Oct 3, 2019 · 7 comments · Fixed by #3554
Closed

Upper-case vs Lower-case for expressions #3271

brevzin opened this issue Oct 3, 2019 · 7 comments · Fixed by #3554
Assignees
Labels
big An issue causing a large set of changes, scattered across most of the text.

Comments

@brevzin
Copy link
Contributor

brevzin commented Oct 3, 2019

Throughout the language part of the standard, arbitrary expressions are introduced in lower-case, .e.g:

The set of potential results of an expression e is defined as follows:

And arbitrary types are introduced in upper-case, e.g.:

A class type T must be complete if:

Both of those are from [basic.def.odr], but it's consistent throughout the language section.


Much of the new library wording from Ranges breaks this convention by introducing expression in upper-case in all the definitions of the CPOs. For instance, from [range.access.begin]:

The expression ranges​::​​begin(E) for some subexpression E is expression-equivalent to:

Is there a particular reason why the Ranges wording uses capital letters for expressions instead of lower-case?

@jensmaurer
Copy link
Member

[algorithms] uses "Let $E$ ..." (using E as a meta-variable for an expression) pervasively.

@CaseyCarter, any opinion here?

@CaseyCarter
Copy link
Contributor

IIRC [algorithms] inconsistently used both \tcode{E} and $E$ as expression placeholders before applying P0896. We chose to use the former as precedent for the placeholder in the CPO specifications. The change to use $E$ consistently throughout [algorithms] happened in San Diego when I was integrating all of the range algorithm specifications into the std flavors.

I have a mild preference for $E$ - whose slanted font makes it "clearly" a meta-syntactic variable - over e - which is itself valid syntax for a C++ expression - as a placeholder, but I'll agree that any consistent style would be an improvement over what's in the working draft right now.

@jensmaurer
Copy link
Member

The general idea for \tcode vs. (e.g.) math formatting is that the former could be valid source code, given the right environment, whereas the latter is used for meta-variables in other situations, such as "atomic operations" or similar. So, using $E$ in the [algorithms] section for stuff that looks like valid code snippets is questionable. However, using lowercase "e" for the CPO specification (in harmony with the core language section) might make sense.

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Oct 4, 2019
@jensmaurer
Copy link
Member

jensmaurer commented Oct 21, 2019

Editorial meeting:

  • Do we want a consistent capitalization convention for the core language part, for types vs. expressions.
  • Do we want to apply this to the library part as well?
  • What should the convention be?

Deferring.

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 4, 2019

image

image

@jensmaurer
Copy link
Member

jensmaurer commented Nov 4, 2019

Editorial meeting: Use math variables for everything, including types. \placeholder remains for exposition-only names and forming parts of an identifier. Range-based for: explain range/begin/end as exposition-only identifiers. Use $T$ primarily, possibly with index, for types. Additionally, use $U$, $V$ for types unrelated to $T$. Use $E$ for expressions, possibly with subscript.

@jensmaurer jensmaurer removed the decision-required A decision of the editorial group (or the Project Editor) is required. label Nov 4, 2019
@jensmaurer
Copy link
Member

See also #326, #3139.

@jensmaurer jensmaurer assigned jensmaurer and unassigned jensmaurer Dec 15, 2019
@jensmaurer jensmaurer added the big An issue causing a large set of changes, scattered across most of the text. label Dec 15, 2019
@jensmaurer jensmaurer self-assigned this Dec 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
big An issue causing a large set of changes, scattered across most of the text.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants