How can I dump an expression into log and execute it

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 13 03:43:02 PDT 2014


On Friday, 11 July 2014 at 23:46:44 UTC, Idan Arye wrote:
>     AST(T) toAST(T)(macro(T) expr){
>         return expr;
>     }

And I mean something like this:

string takeAST(__ast expr)()
{
     return expr.stringof; // need more detailed reflection than 
that of course ;)
}

mixin(takeAST!(2 + 2));


More information about the Digitalmars-d mailing list