DIP 50 - AST macros

luka8088 luka8088 at owave.net
Tue Nov 19 10:41:00 PST 2013


On 18.11.2013. 6:05, Walter Bright wrote:
> On 11/17/2013 7:14 PM, deadalnix wrote:
> 
> Ok, then I'm not seeing what AST macros do that lazy parameters /
> template overloading / mixin templates do not?


Well, this is just a small piece of the puzzle but I would like to be
able to write (as syntax sugar):

query q{
  select data;
}

a compiler to rewrite it to:

mixin(query!(q{
  select data;
}));

if the following exists:

mixin statement query (string code) {
  // ...
}

Maybe I am the only one but I found that string mixins + code generation
are used this way even i Phobos and I find the first syntax much more
cleaner.

Or this is not in the general interest?


More information about the Digitalmars-d mailing list