Jump to page: 1 24  
Page
Thread overview
nested comments?
Jan 01, 2002
Pavel Minayev
Jan 01, 2002
Walter
Jan 01, 2002
Pavel Minayev
Jan 02, 2002
Walter
Jan 02, 2002
Sean L. Palmer
Jan 02, 2002
Pavel Minayev
Jan 02, 2002
Walter
Jan 03, 2002
Pavel Minayev
Jan 17, 2002
OddesE
Jan 17, 2002
Martin York
Jan 17, 2002
Pavel Minayev
Jan 17, 2002
Martin York
Jan 17, 2002
Pavel Minayev
Jan 18, 2002
Ben Cohen
Jan 18, 2002
Russell Borogove
Jan 18, 2002
Pavel Minayev
Jan 19, 2002
Pavel Minayev
Jan 20, 2002
Walter
Jan 20, 2002
Walter
Jan 20, 2002
Sean L. Palmer
Jan 21, 2002
Walter
Jan 18, 2002
la7y6nvo
Jan 19, 2002
Pavel Minayev
Jan 19, 2002
OddesE
Jan 21, 2002
Roberto Mariottini
Jan 20, 2002
Walter
Jan 19, 2002
OddesE
Jan 20, 2002
Pavel Minayev
Jan 20, 2002
OddesE
Jan 07, 2002
Roberto Mariottini
Jan 07, 2002
Pavel Minayev
Jan 08, 2002
Russell Borogove
Jan 08, 2002
Pavel Minayev
Jan 08, 2002
Sean L. Palmer
Jan 08, 2002
Russell Borogove
Jan 08, 2002
Pavel Minayev
January 01, 2002
Are nested multiline /* */ comments allowed in D?


January 01, 2002
no. Use the version statement to block out sections.

"Pavel Minayev" <evilone@omen.ru> wrote in message news:a0t1rg$kjn$1@digitaldaemon.com...
> Are nested multiline /* */ comments allowed in D?
>
>


January 01, 2002
"Walter" <walter@digitalmars.com> wrote in message news:a0tbj5$ptm$1@digitaldaemon.com...

> no. Use the version statement to block out sections.

Unfortunately, version cannot comment out blocks with bad syntax - which is needed sometimes. For example, I occasionally start writing something, then decide to try another idea, but comment the unfinished block out rather than deleting it in case I'll revert back to it later... and such a block may have improper syntax (like "if(a == ").


January 02, 2002
I've been considering making version more tolerant of bad syntax, but it is going to have to count { and } !

"Pavel Minayev" <evilone@omen.ru> wrote in message news:a0th24$svc$1@digitaldaemon.com...
> "Walter" <walter@digitalmars.com> wrote in message news:a0tbj5$ptm$1@digitaldaemon.com...
>
> > no. Use the version statement to block out sections.
>
> Unfortunately, version cannot comment out blocks with bad syntax - which is needed sometimes. For example, I occasionally start writing something, then decide to try another idea, but comment the unfinished block out rather than deleting it in case I'll revert back to it later... and such a block may have improper syntax (like "if(a == ").
>
>


January 02, 2002
That's perfect.  Surely we can make the brackets nest correctly.

Sean

"Walter" <walter@digitalmars.com> wrote in message news:a0tv8q$15rd$1@digitaldaemon.com...
> I've been considering making version more tolerant of bad syntax, but it
is
> going to have to count { and } !
>
> "Pavel Minayev" <evilone@omen.ru> wrote in message news:a0th24$svc$1@digitaldaemon.com...
> > "Walter" <walter@digitalmars.com> wrote in message news:a0tbj5$ptm$1@digitaldaemon.com...
> >
> > > no. Use the version statement to block out sections.
> >
> > Unfortunately, version cannot comment out blocks with bad syntax - which is needed sometimes. For example, I occasionally start writing something, then decide to try another idea, but comment the unfinished block out rather than deleting it in case I'll revert back to it later... and such a block may have improper syntax (like "if(a == ").



January 02, 2002
"Walter" <walter@digitalmars.com> wrote in message news:a0tv8q$15rd$1@digitaldaemon.com...

> I've been considering making version more tolerant of bad syntax, but it
is
> going to have to count { and } !

Still... what's wrong with nested comments? It's really funny to see that, even though ANSI commitee didn't make them standart, most C++ compilers around have a switch which enables them. It's not so hard to implement, but could be a useful thing!


January 02, 2002
"Pavel Minayev" <evilone@omen.ru> wrote in message news:a0ujps$1iqj$1@digitaldaemon.com...
> "Walter" <walter@digitalmars.com> wrote in message news:a0tv8q$15rd$1@digitaldaemon.com...
>
> > I've been considering making version more tolerant of bad syntax, but it
> is
> > going to have to count { and } !
>
> Still... what's wrong with nested comments? It's really funny to see that, even though ANSI commitee didn't make them standart, most C++ compilers around have a switch which enables them. It's not so hard to implement, but could be a useful thing!

I'd like to try using the version statement unless it really reaches a dead end.


January 03, 2002
Walter wrote:

> "Pavel Minayev" <evilone@omen.ru> wrote in message news:a0ujps$1iqj$1@digitaldaemon.com...
> > "Walter" <walter@digitalmars.com> wrote in message news:a0tv8q$15rd$1@digitaldaemon.com...
> >
> > > I've been considering making version more tolerant of bad syntax, but it
> > is
> > > going to have to count { and } !
> >
> > Still... what's wrong with nested comments? It's really funny to see that, even though ANSI commitee didn't make them standart, most C++ compilers around have a switch which enables them. It's not so hard to implement, but could be a useful thing!
>
> I'd like to try using the version statement unless it really reaches a dead end.

... And we have to resort to using a pre-processor!

BTW, I've used M4 for years to do stuff other preprocessors failed to do for me.  I'll probably find uses for M4 with D as well.  Perhaps weeding out code that should not be compiled is a valid use.  Otherwise, all the code you feed in should get compiled, right?


-BobC


January 03, 2002
"Robert W. Cunningham" <rwc_2001@yahoo.com> wrote in message news:3C33BF45.187E8D57@yahoo.com...

> BTW, I've used M4 for years to do stuff other preprocessors failed to do
for
> me.  I'll probably find uses for M4 with D as well.  Perhaps weeding out
code
> that should not be compiled is a valid use.  Otherwise, all the code you
feed
> in should get compiled, right?

Nope, version and debug statements don't compile the code if the condition is not satisfied.


January 07, 2002
"Pavel Minayev" <evilone@omen.ru> ha scritto nel messaggio news:a0th24$svc$1@digitaldaemon.com...
> "Walter" <walter@digitalmars.com> wrote in message news:a0tbj5$ptm$1@digitaldaemon.com...
>
> > no. Use the version statement to block out sections.
>
> Unfortunately, version cannot comment out blocks with bad syntax - which is needed sometimes. For example, I occasionally start writing something, then decide to try another idea, but comment the unfinished block out rather than deleting it in case I'll revert back to it later... and such a block may have improper syntax (like "if(a == ").

I also often need nested comments as a fast way to comment-out weird code.
To me seems better to define a new style of comment to comment out big
blocks of code
(or a block of natural language description). This new "wipe-out" comment
must be
clearly visible and we can choose it can be nested (it's new, so noone
should complain).
I think to something like:

>@@
 .. big block of text, with nested >@@ and <@@ ...
<@@

I like to think this comment must be at column 0, so it's easy to distinguish from normal code

Ciao.


« First   ‹ Prev
1 2 3 4