Scriptlike v0.9.4 - Perl-like interpolated strings, full examples and more.
Sebastiaan Koppe via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Tue Sep 22 18:24:52 PDT 2015
On Tuesday, 22 September 2015 at 20:18:48 UTC, Nick Sabalausky
wrote:
> --------------------------------------------
> // Output: The number 21 doubled is 42!
> int num = 21;
> writeln(
> mixin(interp!"The number ${num} doubled is ${num * 2}!")
> );
> --------------------------------------------
What about:
void echo(T)()
{
writeln(mixin(interp!T));
}
At least it saves some typing.
More information about the Digitalmars-d-announce
mailing list