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
Conversation
There was a problem hiding this 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.
source/preprocessor.tex
Outdated
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, |
There was a problem hiding this comment.
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: ... ]
There was a problem hiding this comment.
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{)}, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
d6dea65
to
ba6cd4c
Compare
Fixes #2116.