-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Reserve macro identifiers #456
Conversation
Something that has been on my mind is using |
@eddyb That seems like a good idea-- however backslashes in macro definitions don't work anyway, so there's no need to reserve anything for now. |
I don't think |
@huonw Yeah, I noted in the RfC that it can't, but since it's a valid token to pass to macros I probably should edit the RfC to ask for it to be reserved everywhere. As for |
FWIW, I've never seen any discussion of this form. I actually find it incredibly ugly (mainly theoretically, but also syntactically) but maybe because I'm just reading it as a token sequence
Yet: there has been a few times where a bug in one of my macros would have been solved by being told that something was unused. I do see removing the option to add these diagnostics as a disadvantage. |
@huonw Hm, agreed. So what about simply focusing on |
How about reserving |
@lifthrasiir That's an interesting idea, but that seems to be too restrictive. Especially since it would leave out one-letter ones which might be useful. |
I prefer reserving |
@reem What if we need more than one? In the case of higher order macros, we might need a distinction. (eg |
I believe that we're planning on using Another factor: we will eventually need to have special syntax for identifier concatenation: perhaps the two special syntaxes for these things could be related. |
Oh, right. In that case |
Why don't we use |
(Background: the macro-producing-macro syntax is covered by rust-lang/rust#6994.) |
During triage meeting, we discussed this PR and decided to close it. We already know we will eventually require a mechanism for introducing keywords into the language as a whole, and that same mechanism could presumably be used here as well. Furthermore, |
Rendered view