The state of string interpolation

Zoadian no at no.no
Thu Dec 6 11:03:23 UTC 2018


would it be possible to have some kind of eponymous mixin 
templates in the language?
I'd imagine it to look something like this:

````
import std.stdio;

mixin template interp(string S) {
     mixin interp = S; //some fancy code to replace ${_var_} with 
content of _var_
}

void main() {
     int a = 5;
     string b = interp!"hello ${a} world";
}
```


More information about the Digitalmars-d mailing list