proposal: heredoc comments to allow `+/` in comments, eg from urls or documented unittests

Nick Sabalausky (Abscissa) SeeWebsiteToContactMe at semitwist.com
Fri Feb 9 09:42:46 UTC 2018


On 02/09/2018 04:23 AM, Kagamin wrote:
> On Friday, 9 February 2018 at 08:57:49 UTC, Timothee Cour wrote:
>> version(none) { FOO } doesn't work if FOO doesn't parse.
> 
> version(none)q"EOS
>    FOO
> EOS";

Huh? So are you *pro-* or *anti-* heredoc?

But ok, that works, unless the code contains `EOS"`. Better change it to:

version(none)q"hey-hey-hey_dudes_I-bet-NOTHINGinMYcode-is-gonna-useTHIS
    FOO
hey-hey-hey_dudes_I-bet-NOTHINGinMYcode-is-gonna-useTHIS";

At least until I go quoting this post in my code. Crap. Guess then I 
could go back to:

version(none)q"EOS
    FOO
EOS";

Or, y'know, just cut out all the noise and just do:

/+
   FOO
+/

and be done with it.


More information about the Digitalmars-d mailing list