What are delimited strings good for?
simendsjo
simen.endsjo at pandavre.com
Sun Apr 10 12:22:30 PDT 2011
On 10.04.2011 21:17, Andrej Mitrovic wrote:
> Are we forgetting the fact that using delimited strings allows us to
> have syntax highlighting in editors?
>
> E.g.:
>
> void stringParser(string str)()
> {
> mixin(str);
> }
>
> void main()
> {
> stringParser!(q{
> int x = 1;
> int y = 2;
>
> writefln("%s %s", x, y);
> });
> }
>
> This is a huge benefit over having everything highlighted in one solid
> color as a string.
That's token strings. This is delimited strings:
q"(foo(xxx))" // "foo(xxx)"
q"[foo{]" // "foo{"
More information about the Digitalmars-d-learn
mailing list