mixin macros -- so tantalizing

Don Clugston dac at nospam.com.au
Fri Sep 7 03:26:42 PDT 2007


With the q{ } token strings we can now do string mixins and get syntax 
highlighting back. It's ugly, though:

mixin(foo(q{a+b*c}));

If we just had something which behaved as

#define func(X) mixin(foo(q{X}))

for example, something like:

mixin alias foo func;

which would declare func as a 'mixin alias' of foo.

(of course, there's the 'macro' keyword as well; 'abstract' is also interesting).
allowing us to write:

func(a+b*c);

which would be instantly applicable. Almost all of the ugliness would disappear 
from my BLADE code, for example.
By contrast, I still haven't seen any use cases for the macros as described in 
the conference presentation!



More information about the Digitalmars-d mailing list