POV-Ray : Newsgroups : povray.beta-test : Nested comments Server Time
29 Jul 2024 18:16:03 EDT (-0400)
  Nested comments (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Alf Peake
Subject: Nested comments
Date: 17 Apr 2002 15:38:11
Message: <3cbdcf23@news.povray.org>
Last 2 lines below are not shown in commented colours. No error
message.

Version 3.5.beta.RC1 win32 (.msvc),
Win98SE, Celeron 500, 160MB.

Alf

 /* This is a comment
 // This too
 /* This also */
 #declare Nothing = sqrt(-1);
 */


Post a reply to this message

From: Christoph Hormann
Subject: Re: Nested comments
Date: 17 Apr 2002 15:46:34
Message: <3CBDD119.66C5E79@gmx.de>
Alf Peake wrote:
> 
> Last 2 lines below are not shown in commented colours. No error
> message.
> 
> [...]

That's a known problem caused by the codemax editor not supporting nested
comments.  This will probably not be changed.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 16 Apr. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Slime
Subject: Re: Nested comments
Date: 17 Apr 2002 20:29:07
Message: <3cbe1353@news.povray.org>
I haven't heard of a language in which that's allowed. Nested comments are
pretty regularly not allowed.

What *does* annoy me, however, is that the following, which should be
perfectly fine:

/* comment /* comment continued */

gives an error, saying that the openings and closings of comments don't
match. I think if nested comments aren't allowed, the program shouldn't
complain about improper nesting.

- Slime
[ http://www.slimeland.com/ ]
[ http://www.slimeland.com/images/ ]


Post a reply to this message

From: Warp
Subject: Re: Nested comments
Date: 17 Apr 2002 20:41:34
Message: <3cbe163e@news.povray.org>
Slime <noo### [at] hotmailcom> wrote:
> I haven't heard of a language in which that's allowed.

  Now you have: The POV-Ray SDL.

> What *does* annoy me, however, is that the following, which should be
> perfectly fine:

> /* comment /* comment continued */

  What do you mean "should be perfectly fine"? By what definition?
  AFAIK there's no universal rule that says that nested comments must not
be supported by any language.
  By the definition of the POV-Ray SDL, that code is bad because it lacks
a closing comment mark (two comments are opened but only one closed).
  This is the corrected version:

/* comment /* comment continued */ */

> gives an error, saying that the openings and closings of comments don't
> match. I think if nested comments aren't allowed, the program shouldn't
> complain about improper nesting.

  What do you mean "nested comments aren't allowed"? Of course they are
allowed. And they work pretty fine.

  The great thing about nested comments being supported is that if you
have a piece of code with lots of /*...*/ comments and then you want to
comment out the entire piece of code, it works just fine. For example in C
you just can't do it. (Well, in C you can do #if(0) ... #endif, but don't
expect any editor to color that block as a comment.)
  The fact that the Codemax editor does not support coloring of nested
comments is unfortunate, but that doesn't make them unallowed. Coloring
means nothing to POV-Ray.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Slime
Subject: Re: Nested comments
Date: 17 Apr 2002 20:49:24
Message: <3cbe1814$1@news.povray.org>
Wait, POV-Ray allows nested comments?!?

*tests*

Woah! sweet! all this time I figured they weren't because the color coding
didn't support them! Hah...

Well, I feel silly. Resume your lives.

- Slime
[ http://www.slimeland.com/ ]
[ http://www.slimeland.com/images/ ]


Post a reply to this message

From: TinCanMan
Subject: Re: Nested comments
Date: 18 Apr 2002 07:34:21
Message: <3cbeaf3d$1@news.povray.org>
> What *does* annoy me, however, is that the following, which should be
> perfectly fine:
>
> /* comment /* comment continued */
>
> gives an error, saying that the openings and closings of comments don't
> match. I think if nested comments aren't allowed, the program shouldn't
> complain about improper nesting.


Patient: It hurts when I do this.
Doctor: Stop doing that.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Nested comments
Date: 18 Apr 2002 10:34:09
Message: <3cbed961@news.povray.org>
In article <3cbe1353@news.povray.org> , "Slime" <noo### [at] hotmailcom> wrote:

> /* comment /* comment continued */
>
> gives an error, saying that the openings and closings of comments don't
> match. I think if nested comments aren't allowed, the program shouldn't
> complain about improper nesting.

And how could it then determine if you want a part to be commented out or not?
If you think about what you are suggesting carefully you will find that what
you are expecting is mind-reading :-)

    Thorsten


Post a reply to this message

From: Alf Peake
Subject: Re: Nested comments
Date: 18 Apr 2002 10:59:26
Message: <3cbedf4e@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3cbe163e@news.povray.org...
[snip]
>   The great thing about nested comments being supported is that if
you
> have a piece of code with lots of /*...*/ comments and then you want
to
> comment out the entire piece of code, it works just fine.

This is exactly what I have always done since pov 2 in DOS. I'm new to
WinPov, wanted to play with 3.5 :) and wasn't aware of this codemax
error.

Alf


Post a reply to this message

From: Slime
Subject: Re: Nested comments
Date: 18 Apr 2002 11:18:15
Message: <3cbee3b7$1@news.povray.org>
> > /* comment /* comment continued */

> And how could it then determine if you want a part to be commented out or
not?
> If you think about what you are suggesting carefully you will find that
what
> you are expecting is mind-reading :-)

Under my assumption that POV-Ray does not support nested comments, which has
been corrected, I would have expected it to behave like languages that
*don't* support nested comments, and simply ignore the second /*, since once
you're in a comment, the only thing that should be responded to is the
closing */.

- Slime
[ http://www.slimeland.com/ ]
[ http://www.slimeland.com/images/ ]


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Nested comments
Date: 18 Apr 2002 13:41:40
Message: <3cbf0554@news.povray.org>
In article <3cbee3b7$1@news.povray.org> , "Slime" <noo### [at] hotmailcom> wrote:

>> > /* comment /* comment continued */
>
>> And how could it then determine if you want a part to be commented out or
> not?
>> If you think about what you are suggesting carefully you will find that
> what
>> you are expecting is mind-reading :-)
>
> Under my assumption that POV-Ray does not support nested comments, which has
> been corrected, I would have expected it to behave like languages that
> *don't* support nested comments, and simply ignore the second /*, since once
> you're in a comment, the only thing that should be responded to is the
> closing */.

Ah, so you had not seen Christoph Hormann's response which already noted that
nested comments are support just not in the editor.  It is really hard to
figure out when you responded because of the wrong date in your posts.  All
your posts are over six days older...

    Thorsten


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.