January 23, 2002
"OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2n531$2dm0$1@digitaldaemon.com...
>
> What I don't understand is that some of you defend non-nesting
> comments so fiercefully.
> When discussing nesting comments, the reasons for not having
> them usually boil down to two things:
>
> 1) You don't need them
> 2) It is not standard
>
> I just don't see what the big problem with nested comments is. Please explain that to me. Would some things go terribly wrong, or be very diffcult?

   Well... don't generalize. I, for one, already posted a positive and
constructive reason to have non-nesting comments (the /* /*/ //*/ trick).

   1), as you well say, is not a good reason. You can definitely use nesting
comments to good effect or removing pieces of code. There are alternatives,
though, which is what people are saying. Is there anything you use nesting
comments for, that would not work with alternatives? The two main
alternatives are: use multiple single-line comments like we do in Assembler
or in makefiles (most editors can insert/remove such things using macros and
such), and use a language-construct like "version() {}" to remove unwanted
pieces of code without deleting them.

   2) is completely bogus, IMHO. It might not be C or C++ standard, but only
Walter can say wether it is or not D standard.

Salutaciones,
                         JCAB



January 23, 2002
OddesE wrote:

> What I don't understand is that some of you defend non-nesting
> comments so fiercefully.
> When discussing nesting comments, the reasons for not having
> them usually boil down to two things:
>
> 1) You don't need them
> 2) It is not standard

My reason for not liking nesting comments is that it makes it non-obvious what code is active and what is not.  If I see a */ I tend to think, "end of comment", not "end of nested block".  That's why I like the /{   }/ syntax, as it really looks like a block, and I'm used to blocks being inside of blocks.

My 2 cents :)

--
The Villagers are Online! villagersonline.com

.[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ]
.[ (a version.of(English).(precise.more)) is(possible) ]
?[ you want.to(help(develop(it))) ]


January 23, 2002
Mike Wynn wrote:

> Have you considered looking for <HTML> at the begining of every source file
> in fact < appears as the first non white space char, then the chances are
> that its D inside HTML. so a program can begin <code>
> if you then removed <SPAN> (nested) areas from within the <code> sections
> you get have nestable comments without changing the syntax of D
> 
> or use <span> </span>
> always as nestable comment always
> 
> or to veiw comments with a bit of logic ...
> /* */  original c comments
> //       one line c++ comments
> why not continue the trend
> /{   }/  nestable D comments
> 
> /<symbol> is comment { we all know is block/scope
> 
> 
> "Walter" <walter@digitalmars.com> wrote in message
> news:a2kr5h$r70$2@digitaldaemon.com...
> 
>>I've followed all the nested/not nested comment discussions with interest.
>>
> I
> 
>>am reluctant to change the meaning of /* */ from C and C++.
>>
>>How about a new comment style,
>>
>>    {{ nested comment }}
>>
>>to indicate nested comments? Is it just too lame to have three (3)
>>
> different
> 
>>commenting methods in D?
>>
>>
> 
> 
> Mike.
> 
> 
> 


I think the documentation comment syntax died or is hibernating and
waiting for d/XML discussion to "finalise".

My suggestion for documentation comments is that we have,


// - single line comment

/* - multi line comment
/{ - nested comments

ergo,

/@ - documentation comment (taken from javadoc @blah syntax)


Yeah, one more comment type for d.

As far as compiler is concerned /* and /@ are at the same level,
and /{ would nest all the comment types.


g'bye,

- nik.


January 23, 2002
"nik" <nik@nospam.org> wrote in message news:3C4F2489.1010507@nospam.org...
> Mike Wynn wrote:
>
> > Have you considered looking for <HTML> at the begining of every source
file
> > in fact < appears as the first non white space char, then the chances
are
> > that its D inside HTML. so a program can begin <code>
> > if you then removed <SPAN> (nested) areas from within the <code>
sections
> > you get have nestable comments without changing the syntax of D
> >
> > or use <span> </span>
> > always as nestable comment always
> >
> > or to veiw comments with a bit of logic ...
> > /* */  original c comments
> > //       one line c++ comments
> > why not continue the trend
> > /{   }/  nestable D comments
> >
> > /<symbol> is comment { we all know is block/scope
> >
> >
> > "Walter" <walter@digitalmars.com> wrote in message news:a2kr5h$r70$2@digitaldaemon.com...
> >
> >>I've followed all the nested/not nested comment discussions with
interest.
> >>
> > I
> >
> >>am reluctant to change the meaning of /* */ from C and C++.
> >>
> >>How about a new comment style,
> >>
> >>    {{ nested comment }}
> >>
> >>to indicate nested comments? Is it just too lame to have three (3)
> >>
> > different
> >
> >>commenting methods in D?
> >>
> >>
> >
> >
> > Mike.
> >
> >
> >
>
>
> I think the documentation comment syntax died or is hibernating and waiting for d/XML discussion to "finalise".
>
> My suggestion for documentation comments is that we have,
>
>
> // - single line comment
>
> /* - multi line comment
> /{ - nested comments
>
> ergo,
>
> /@ - documentation comment (taken from javadoc @blah syntax)
>
>
> Yeah, one more comment type for d.
>
> As far as compiler is concerned /* and /@ are at the same level, and /{ would nest all the comment types.
>
>
> g'bye,
>
> - nik.
>

Agreed, except that Walter seems to want to keep
'@' reserved... :)
I kinda liked my /*doc  ... doc*/ syntax, but maybe
it is to verbatim?


--
Stijn
OddesE_XYZ@hotmail.com
http://OddesE.cjb.net
__________________________________________
Remove _XYZ from my address when replying by mail



January 23, 2002
"Juan Carlos Arevalo Baeza" <jcab@roningames.com> wrote in message news:a2n6cc$2g2n$1@digitaldaemon.com...
> "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2n531$2dm0$1@digitaldaemon.com...
> >
> > What I don't understand is that some of you defend non-nesting
> > comments so fiercefully.
> > When discussing nesting comments, the reasons for not having
> > them usually boil down to two things:
> >
> > 1) You don't need them
> > 2) It is not standard
> >
> > I just don't see what the big problem with nested comments is. Please explain that to me. Would some things go terribly wrong, or be very diffcult?
>
>    Well... don't generalize. I, for one, already posted a positive and
> constructive reason to have non-nesting comments (the /* /*/ file://*/
trick).
>
>    1), as you well say, is not a good reason. You can definitely use
nesting
> comments to good effect or removing pieces of code. There are
alternatives,
> though, which is what people are saying. Is there anything you use nesting comments for, that would not work with alternatives? The two main alternatives are: use multiple single-line comments like we do in
Assembler
> or in makefiles (most editors can insert/remove such things using macros
and
> such), and use a language-construct like "version() {}" to remove unwanted
> pieces of code without deleting them.
>
>    2) is completely bogus, IMHO. It might not be C or C++ standard, but
only
> Walter can say wether it is or not D standard.
>
> Salutaciones,
>                          JCAB
>
>

I agree that your trick is a valid reason for non nesting comments,
but I think what you are doing when you use that trick, is actually
something that the version() construct is ideal for!
Commenting out code using version() on the other hand seems
to me as a hack-like solution.

Anyway, I was sure I was going to get flamed when I posted the previous message, but it is very refreshing to see that I was not. Thanks!

(It seems to me there is *very* little flaming and trolling going
on on news.digitalmars.com\D. Some newsgroups I have been
to (comp.lang.c++) contain a lot of flaming. I'm really happy
that none of that is going on here. Sometimes I just didn't dare
to speak my mind there. Thanks everyone!)


--
Stijn
OddesE_XYZ@hotmail.com
http://OddesE.cjb.net
__________________________________________
Remove _XYZ from my address when replying by mail



January 23, 2002
"OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2nc88$2kbr$1@digitaldaemon.com...

> Anyway, I was sure I was going to get flamed when I posted the previous message, but it is very refreshing to see that I was not. Thanks!

   You're welcome.

> (It seems to me there is *very* little flaming and trolling going
> on on news.digitalmars.com\D. Some newsgroups I have been
> to (comp.lang.c++) contain a lot of flaming. I'm really happy
> that none of that is going on here. Sometimes I just didn't dare
> to speak my mind there. Thanks everyone!)

   This is probably because the whole purpose of the newsgroup is to help in
the design and development of this new language, which nobody has quite
"learned" yet. We don't have all that many religious beliefs about the
language proper to ignite the flames. I hope I'm making sense here :)

Salutaciones,
                         JCAB



January 23, 2002
OddesE wrote:

> What I don't understand is that some of you defend non-nesting
> comments so fiercefully.
> When discussing nesting comments, the reasons for not having
> them usually boil down to two things:
> 
> 1) You don't need them
> 2) It is not standard

My whole point was, at the line level, we _do_ have

nesting comments. Does anyone need nesting comments
at the character/token level?


-Russell B

January 24, 2002
"Russell Borogove" <kaleja@estarcion.com> wrote in message news:3C4F3861.8070604@estarcion.com...
> OddesE wrote:
>
> > What I don't understand is that some of you defend non-nesting
> > comments so fiercefully.
> > When discussing nesting comments, the reasons for not having
> > them usually boil down to two things:
> >
> > 1) You don't need them
> > 2) It is not standard
>
> My whole point was, at the line level, we _do_ have
>
> nesting comments. Does anyone need nesting comments
> at the character/token level?
>
>
> -Russell B
>

Yes, I do!    :)

But in the end it all depends on how you define 'need'.
I know I would really like them.


--
Stijn
OddesE_XYZ@hotmail.com
http://OddesE.cjb.net
__________________________________________
Remove _XYZ from my address when replying by mail



January 25, 2002
"Juan Carlos Arevalo Baeza" <jcab@roningames.com> wrote in message news:a2nctu$2krk$1@digitaldaemon.com...
> "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:a2nc88$2kbr$1@digitaldaemon.com...
>
> > Anyway, I was sure I was going to get flamed when I posted the previous message, but it is very refreshing to see that I was not. Thanks!
>
>    You're welcome.
>
> > (It seems to me there is *very* little flaming and trolling going
> > on on news.digitalmars.com\D. Some newsgroups I have been
> > to (comp.lang.c++) contain a lot of flaming. I'm really happy
> > that none of that is going on here. Sometimes I just didn't dare
> > to speak my mind there. Thanks everyone!)
>
>    This is probably because the whole purpose of the newsgroup is to help
in
> the design and development of this new language, which nobody has quite "learned" yet. We don't have all that many religious beliefs about the language proper to ignite the flames. I hope I'm making sense here :)

I've always found, in many years of selling compilers, that the kinds of programmers interested in Digital Mars, Zortech, etc., are a definite cut above the rest. That makes building products for you all worthwhile.

-Walter


January 31, 2002
"Mike Wynn" <mike.wynn@l8night.co.uk> wrote in message news:a2kvgk$tka$1@digitaldaemon.com...
> or to veiw comments with a bit of logic ...
> /* */  original c comments
> //       one line c++ comments
> why not continue the trend
> /{   }/  nestable D comments

Your trend idea is a good one; what I've done is do /+  +/ for nested comments. Why not /{  }/? It just didn't look right on the page. I also worried about things like:

    foo() { blah... }// comment

the } and the / just don't go together. The /+ looks similar enough to /* to be recognizable as a comment, but different enough to not be confusing:

    /+
        code
        code
     +/

or even:

    /+++++++++++++
        code that doesn't work
        code that doesn't work
     +++++++++++++/

has a bit of a cachet to it. I thought of /- -/, but it wound up looking like someone trying to draw a picture instead of a comment <g>.

www.digitalmars.com/d/lex.html