WYSIWYG string still limited
Robert DaSilva
sp.unit.262+digitalmars at gmail.com
Sat Dec 15 13:14:06 PST 2007
Swer wrote:
> r"abc\s*$" ok
> r"abc"s*$" fail
>
> `abc"s*$` ok
> `abc`s*$` fail
>
> as a improvement from C/C++, D use [`] as WYSIWYG string delimiter easy to
> use, but still not enough. why dont perfect solution to WYSIWYG string. perl
> has one, but not fit for D. My poposal below.
>
> pargam(delimiter, "[[WYSIWYG]]");
>
> const char [] somestr = [[WYSIWYG]]
> You can use write any some here.
> const char [] code_demo1 = `demo1`;
> const char [] code_demo2 = r"demo2";
> [[WYSIWYG]]
>
> ofcause you can replace the delimiter from "[[WYSIWYG]]" to any string you
> like.
>
>
We do.
q"[do"too]"
http://www.digitalmars.com/d/lex.html#StringLiteral
More information about the Digitalmars-d
mailing list