Jump to page: 1 26  
Page
Thread overview
proposal: heredoc comments to allow `+/` in comments, eg from urls or documented unittests
Feb 09, 2018
Timothee Cour
Feb 09, 2018
Kagamin
Feb 09, 2018
Kagamin
Feb 09, 2018
Timothee Cour
Feb 09, 2018
Kagamin
Feb 09, 2018
Kagamin
Feb 09, 2018
Kagamin
Feb 13, 2018
timotheecour
Feb 13, 2018
Kagamin
Feb 09, 2018
Kagamin
Feb 09, 2018
Jonathan M Davis
Feb 09, 2018
Kagamin
Feb 09, 2018
Timothee Cour
Feb 09, 2018
Kagamin
Feb 09, 2018
Kagamin
Feb 09, 2018
Kagamin
Feb 10, 2018
Vladimir Panteleev
Feb 10, 2018
Kagamin
Feb 10, 2018
Walter Bright
Feb 11, 2018
Jonathan M Davis
Feb 11, 2018
Vladimir Panteleev
Feb 11, 2018
Timothee Cour
Feb 11, 2018
Walter Bright
Feb 11, 2018
Jonathan M Davis
Feb 11, 2018
Walter Bright
Feb 12, 2018
Walter Bright
Feb 12, 2018
timotheecour
Feb 12, 2018
Elie Morisse
Feb 12, 2018
Walter Bright
Feb 12, 2018
Patrick Schluter
Feb 12, 2018
Walter Bright
Feb 12, 2018
Walter Bright
Feb 12, 2018
Jacob Carlborg
Feb 12, 2018
Walter Bright
Feb 12, 2018
David Nadlinger
Feb 13, 2018
Jacob Carlborg
Feb 11, 2018
Vladimir Panteleev
Feb 11, 2018
ag0aep6g
Feb 12, 2018
Walter Bright
Feb 12, 2018
timotheecour
Feb 12, 2018
Walter Bright
February 08, 2018
same exact idea as motivation for delimited strings (https://dlang.org/spec/lex.html#delimited_strings)

```

auto heredoc = q"EOS
This is a multi-line
heredoc string
EOS"
;

/"EOC
This is a multi-line
heredoc comment allowing
/+ documented unittests containing nesting comments +/
and weird urls like https://gcc.gnu.org/onlinedocs/libstdc++/faq.html
EOS"/

```
February 09, 2018
On 02/08/2018 10:06 PM, Timothee Cour wrote:
> 
> /"EOC
> This is a multi-line
> heredoc comment allowing
> /+ documented unittests containing nesting comments +/

That shouldn't be an issue as long as you're using /++ doc comments and not /** ones. If it IS a problem, I'd regard it as a bug.

(If I were in change of the world, /** and /* both would be compiler errors, banned from all commits, and non-nesting block comments of all types would be prohibited from all langauges upon pain of...well, pain. They are spawn of satan and should never exist.)

> and weird urls like https://gcc.gnu.org/onlinedocs/libstdc++/faq.html

*That* is a compelling point: Any embedded langauge (such as URL syntax) where +/ is valid. That, and maybe any code examples or discussions which, for any reason, intentially involve an unmatched end-of-comment.
February 09, 2018
/**
This is a multi-line
heredoc comment allowing
// documented unittests containing nesting comments
and weird urls like https://gcc.gnu.org/onlinedocs/libstdc++/faq.html
*/
February 09, 2018
On Friday, 9 February 2018 at 07:04:26 UTC, Nick Sabalausky (Abscissa) wrote:
> (If I were in change of the world, /** and /* both would be compiler errors, banned from all commits, and non-nesting block comments of all types would be prohibited from all langauges upon pain of...well, pain. They are spawn of satan and should never exist.)

Nested comments are superficial though, they were a mistake, really.
February 09, 2018
On 02/09/2018 03:42 AM, Kagamin wrote:
> 
> Nested comments are superficial though, 

Not if you've ever commented out a block of code.
February 09, 2018
On Friday, 9 February 2018 at 03:06:56 UTC, Timothee Cour wrote:
> /"EOC
> This is a multi-line
> heredoc comment allowing
> /+ documented unittests containing nesting comments +/

Are you sure documented unittests work that way? https://run.dlang.io/is/grNpKK
February 09, 2018
On 02/09/2018 03:37 AM, Kagamin wrote:
> /**
> This is a multi-line
> heredoc comment allowing
> // documented unittests containing nesting comments
> and weird urls like https://gcc.gnu.org/onlinedocs/libstdc++/faq.html
> */


/**
This is a multi-line comment.
Be sure to check the various files at extras/foo*/package.d
And also: https://gcc.gnu.org/onlinedocs/libstdc++/faq.html
*/


Kaboom. Thank you, good night.
February 09, 2018
On Friday, 9 February 2018 at 08:44:31 UTC, Nick Sabalausky (Abscissa) wrote:
> On 02/09/2018 03:42 AM, Kagamin wrote:
>> 
>> Nested comments are superficial though,
>
> Not if you've ever commented out a block of code.

Comment this:
string sedArg="s/ +/ /";

Comments don't respect even lexical structure of commented code that you expect, version(none) does.
February 09, 2018
summary:
* `/* */` should never be used
* properly nested `/+ +/` indeed don't cause issues
* urls cause issues and I've ran into this issue multiple times
* unrestricted code (eg foreign code or unfinished D code commented
out) also cause issues
* hreredoc comments fixes these issues when neeeddd



On Fri, Feb 9, 2018 at 12:49 AM, Nick Sabalausky (Abscissa) via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> On 02/09/2018 03:37 AM, Kagamin wrote:
>>
>> /**
>> This is a multi-line
>> heredoc comment allowing
>> // documented unittests containing nesting comments
>> and weird urls like https://gcc.gnu.org/onlinedocs/libstdc++/faq.html
>> */
>
>
>
> /**
> This is a multi-line comment.
> Be sure to check the various files at extras/foo*/package.d
> And also: https://gcc.gnu.org/onlinedocs/libstdc++/faq.html
> */
>
>
> Kaboom. Thank you, good night.
February 09, 2018
version(none) { FOO } doesn't work if FOO doesn't parse.

Again, what I proposed is the only 100% reliable way to comment out something

On Fri, Feb 9, 2018 at 12:52 AM, Kagamin via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> On Friday, 9 February 2018 at 08:44:31 UTC, Nick Sabalausky (Abscissa)
> wrote:
>>
>> On 02/09/2018 03:42 AM, Kagamin wrote:
>>>
>>>
>>> Nested comments are superficial though,
>>
>>
>> Not if you've ever commented out a block of code.
>
>
> Comment this:
> string sedArg="s/ +/ /";
>
> Comments don't respect even lexical structure of commented code that you
> expect, version(none) does.
« First   ‹ Prev
1 2 3 4 5 6