Source expression passed to a lazy parameter

Per Nordlöw per.nordlow at gmail.com
Mon Apr 9 08:27:50 UTC 2018


Is it possible to get the source expression sent to a lazy 
function?

So that I can implement something like

show(Arg)(lazy Arg arg)
{
     writeln(arg.sourceof, arg);
}

used as

     show(1+2+3);

will print

     1+2+3:6



More information about the Digitalmars-d-learn mailing list