"string interpolation"

Nicholas Wilson iamthewilsonator at hotmail.com
Sun Jun 9 00:53:23 UTC 2019


On Saturday, 8 June 2019 at 21:28:13 UTC, Amex wrote:
> I and many others write a code that uses string mixins simply 
> to define a symbol based on others:
>
> mixin(T~" "~id~" = "~value~");");
>
>
> This is very ugly and it is impossible to debug properly.

Specifically for the case for mixins they accept comma separated 
stuff. Stuff that is not a string will be converted through it 
`.stringof` property (e.g. types).


mixin(T, " ", id, " = ", value, ");");


More information about the Digitalmars-d mailing list