Special Code String for mixins

Shachar Shemesh via Digitalmars-d digitalmars-d at puremagic.com
Wed Mar 15 07:13:28 PDT 2017


On 15/03/17 15:50, Inquie wrote:
> I hate building code strings for string mixins as it's very ugly and
> seems like a complete hack.
>

What I usually do is use the q{} format. Vim does syntax highlighting on it:

string code = q{
	immutable int a = %s;
	}.format(something);
...
mixin(code);


More information about the Digitalmars-d mailing list