On 04/20/2017 02:40 PM, Nick Sabalausky (Abscissa) wrote:

auto exho()
{
     return writeln("${name} and this are app ${age*365*24} hours!");
}


Correction:

auto exho()
{
    return writeln(
        ""~
        _interp_text(name)~
        " and this are app "~
        _interp_text(age*365*24)~
        " hours!"
    );
}

Where _interp_text is really just a thin wrapper over std.conv.text.

Again, note that `name` and `age` are undefined symbols unless exho is defined as a nested function within the function that actually defines `name` and `age`.

And again, this is exactly why interp!"..." was forced to work by returning a string for the caller to mixin.

Reply via email to