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

P1042R1 __VA_OPT__ wording clarifications #2148

Merged
merged 2 commits into from Jun 18, 2018
Merged

Conversation

tkoeppe
Copy link
Contributor

@tkoeppe tkoeppe commented Jun 10, 2018

Fixes #2116.

@tkoeppe tkoeppe added this to the post-2018-06 milestone Jun 10, 2018
Copy link
Member

@zygoloid zygoloid left a comment

Choose a reason for hiding this comment

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

Application of motion looks fine, but I have some concerns with the clarity of the text as moved.

is replaced by the corresponding argument after all macros
contained therein have been expanded.
Before being substituted,
contained therein have been expanded, in which case,
Copy link
Member

Choose a reason for hiding this comment

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

I don't like this "in which case"; I think it makes the wording more confusing, because it could be referring to the case where the "unless" part holds or the case where it doesn't hold. For example, the more natural construction "X does Y unless Z, in which case Q" would mean that X does Y if !Z and Q happens if Z. I also don't like the condition for this being hyphened into the middle of the sentence. How about this instead:

For each parameter in the replacement list that is neither preceded by a # or ## preprocessing token nor followed by a ## preprocessing token, the preprocessing tokens naming the parameter are replaced by a token sequence determined as follows:

  • If the parameter is of the form __VA_OPT__(content), the replacement preprocessing tokens are the preprocessing token sequence for the corresponding argument.
  • Otherwise, the replacement preprocessing tokens are the preprocessing tokens of corresponding argument after all macros contained therein have been expanded. The argument's preprocessing tokens are completely macro replaced before being substituted as if they formed the rest of the preprocessing file with no other preprocessing tokens being available.

[ Example: ... ]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like that. I've left the open sentence of the containing paragraph intact and then applied this change.

@hubert-reinterpretcast: any opinions?

shall always occur as part of the token sequence
\mname{VA_OPT}\tcode{(}\placeholder{content}\tcode{)},
shall always occur as part of the preprocessing token sequence
\mname{VA_OPT}\tcode{(}\placeholder{cont\-ent}\tcode{)},
Copy link
Member

Choose a reason for hiding this comment

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

We should describe __VA_OPT__(content) in the grammar and give it a production name like we do for defined-macro-expression and has-include-expression.

Copy link
Member

Choose a reason for hiding this comment

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

Let's leave this one for after the motions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed issue #2185 to track this.

Copy link
Contributor

@hubert-reinterpretcast hubert-reinterpretcast left a comment

Choose a reason for hiding this comment

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

The restructuring looks good to me.

@zygoloid zygoloid merged commit 980486e into master Jun 18, 2018
@jensmaurer jensmaurer deleted the motions-2018-06-cwg-4 branch October 19, 2019 20:04
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.

None yet

3 participants