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

[intro.execution] p10 Ambiguous meaning with the "and" #6191

Closed
xmh0511 opened this issue Mar 16, 2023 · 4 comments
Closed

[intro.execution] p10 Ambiguous meaning with the "and" #6191

xmh0511 opened this issue Mar 16, 2023 · 4 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Mar 16, 2023

[intro.execution] p10 says

Except where noted, evaluations of operands of individual operators and of subexpressions of individual expressions are unsequenced.

We use "sequence" to describe the relationship between two evaluations. Say o1 and o2 are evaluations of operands of an individual operator, s1 and s2 are evaluations of an individual expression.

What does the sentence mean?

  1. any of o1 and o2 is unsequenced with any of s1 and s2
  2. o1 is unsequenced with o2, s1 is unsequenced with s2

The "and" in the sentence arises ambiguity. The improvement might be:

Except where noted, the evaluations in the following are unsequenced:

  • evaluations of operands of individual operators
  • evaluations of subexpressions of individual expressions
@jensmaurer
Copy link
Member

The two interpretations conflate to your first case, because operands of operators are also subexpressions of the compound (operator) expression, for example:
a + b
There, a and b are unsequenced under both branches of the "and".

@xmh0511
Copy link
Contributor Author

xmh0511 commented Mar 17, 2023

So, the constructive way is clearer here, I think.

@jensmaurer
Copy link
Member

I disagree. You're using "in", which is ambiguous to whether it applies to the first level only, or all the way down.

@xmh0511
Copy link
Contributor Author

xmh0511 commented Mar 17, 2023

I disagree. You're using "in", which is ambiguous to whether it applies to the first level only, or all the way down.

Except where noted, the evaluations of expressions are defined as:

  • evaluations of operands of individual operators are unsequenced, or
  • evaluations of subexpressions of individual expressions are unsequenced

That is, for a + b, we can use both the two bullets defined in the list to interpret the case.

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

No branches or pull requests

2 participants