[Issue 2698] Parameterised identifier
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon May 14 13:15:34 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=2698
Nick Treleaven <nick at geany.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |nick at geany.org
--- Comment #3 from Nick Treleaven <nick at geany.org> ---
(In reply to Daniel Keep from comment #0)
> int __ident(name)() { return __ident("_"~name~"storage"); }
Wow, this was an insightful idea from 2009! It has recently been re-discovered
in 2015:
https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1010.md#mixin-identifiers
I prefer the __identifier(ident) syntax than mixin(ident), it's less noisy as:
1. it doesn't get highlighted as a keyword.
2. it's clearer what kind of token is being introduced.
3. it doesn't refine the idea of mixin to more than just expressions/statements
(i.e. code, not an identifier).
--
More information about the Digitalmars-d-bugs
mailing list