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

[format.parse.ctx] improve readability of paragraphs 12 and 14 #6815

Merged
merged 2 commits into from Feb 22, 2024

Conversation

Eisenwave
Copy link
Contributor

@Eisenwave Eisenwave commented Feb 22, 2024

Fixes #6801.

image

I have had great difficulty reading paragraph 14 prior to this edit. There are multiple reasons for that:

  1. It was 1AM when I've opened the issue.
  2. I was unfamiliar with the wording "Call expressions". "Calls to this function" is commonly found in the standard and it's much more obvious that it refers to this function, not some call expressions in general.
  3. The old wording is a huge grammatical sandwich of the form "Call expressions where ... are not core constant expressions.". The sentence goes on for quite a while and connecting the beginning to the end is mentally challenging.
  4. The whole sentence is a double negation of the form "Call expressions where ... is not one of the types ... are not ...". This double negation makes it hard to comprehend what the condition actually is, especially within this sandwich structure.
  5. The sentence starts with "Call expressions where ... or ...". Until one has read the sentence completely, it's unclear how far the "or" will go. It basically requires the reader to properly apply "operator precedence" to make sense of this sentence solely because of the sandwich structure. If all conditions were at the end, this wouldn't be an issue.

Here's a visualization of the old structure:

Call expressions where
        id >= num_args_ or
        the type of the corresponding format argument
                (after conversion to basic_format_arg<Context>)
                is not one of the types in Ts...
are not core constant expressions ([expr.const]).

It should be obvious that navigating this sentence structure is fairly complex.

This edit resolves all these issues and makes corresponding changes to paragraph 12.

source/utilities.tex Outdated Show resolved Hide resolved
Co-authored-by: Jonathan Wakely <github@kayari.org>
Copy link
Member

@jwakely jwakely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@jensmaurer jensmaurer merged commit 0908406 into cplusplus:main Feb 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[format.parse.ctx] Paragraph 14 is hard to read
3 participants