Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up[WIP] Allow macros in identifier position #14266
Conversation
This comment has been minimized.
This comment has been minimized.
|
cc me @sfackler |
This comment has been minimized.
This comment has been minimized.
|
This probably needs an RFC. |
bgamari
added some commits
May 17, 2014
This comment has been minimized.
This comment has been minimized.
|
@huonw I can try putting together an RFC if necessary. Is it the grammar changes that are concerning? |
This comment has been minimized.
This comment has been minimized.
|
And the interactions with hygiene. |
bgamari
added some commits
May 18, 2014
This comment has been minimized.
This comment has been minimized.
|
Closing, this change is definitely one that warrants an RFC. This looks pretty awesome, however, and I would love to see this implemented! Some thoughts that may affect the writeup of the RFC:
There may be other concerns, but I'm sure an RFC would flesh them out! |
alexcrichton
closed this
May 21, 2014
This comment has been minimized.
This comment has been minimized.
|
@bgamari, @alexcrichton: So why was this PR abandoned? Were there any technical problems with it, or just the absence of an RFC? |
This comment has been minimized.
This comment has been minimized.
|
Ah sorry, my memory is a little hazy on this, but I believe it would definitely need to start out with an RFC today. |
This comment has been minimized.
This comment has been minimized.
|
There was an RFC and it was rejected. Though it doesn't point to this PR specifically (which is technically superior in that it doesn't increase the size of It seems a bit odd to me that it was, because we have since added pattern macros and trait/impl interior macros (i.e. macros that can expand to methods or associated items). Making ident macros unstable to use should avoid any de facto problematic design stabilization. |
This comment has been minimized.
This comment has been minimized.
|
I don't quite understand how UFCS resolves the desired syntax sugar from my comment in that RFC (if it's meant to). I specifically want a sugaring that looks like this: |
This comment has been minimized.
This comment has been minimized.
|
@SiegeLord I don't see how that's relevant, you seem to want something which doesn't expand to a single identifier. I am talking about identifier macros in method name position, which caused some issues during the implementation of this, though I don't see them mentioned anywhere now. |
This comment has been minimized.
This comment has been minimized.
|
Oh, I think this was is about conflicts between ident macros and hypothetical method macros (which you seem to be referring to). In which case, what I meant about UFCS is that it removes the requirement for the former (you wouldn't use ident macros for methods outside of macros yourself, I wouldn't think), leaving the obvious syntax for the latter. |
This comment has been minimized.
This comment has been minimized.
|
So shall we reopen the RFC (and this PR)? Not being able to create new idents in macros is annoying. |
bgamari commentedMay 17, 2014
This allows macros to be used in identifier position of items, making
concat_idents!far more useful. This is very much a work in progress.