POV-Ray : Newsgroups : povray.general : POV-Ray Error Messages : Re: POV-Ray Error Messages Server Time
13 Aug 2024 09:29:24 EDT (-0400)
  Re: POV-Ray Error Messages  
From: Ron Parker
Date: 24 Sep 1998 17:56:02
Message: <360ab1e2.0@news.povray.org>
On Thu, 24 Sep 1998 11:03:31 -0700, Ken <tyl### [at] pacbellnet> wrote:
>What practical purpose does Pov's non-fatal error messages serve.
>Example using the new syntax of 3.1:
>
>wrong  #delclare Red =  rgb<1,0,0>
>correct #delclare Red =  rgb<1,0,0>;
>
>
>Notice the missing ";" ?
>Without the semicolon an error is reported stated "all declared float ..."
>    My argument is if the syntax does not actually affect the outcome
>of the desired feature why report it as an error at all ?

The syntax does affect the outcome.  Consider this:

#declare Center=<0,0,0>;
union {
    #while (Center.x < 10)
        sphere {
            #declare Center = Center + x;
            -Center - y
            1.5
        }
    #end
    texture {...}
}

Now this is admittedly contrived and stupid, but notice that if the
semicolon weren't there, it would not be at all obvious (to the parser,
which ignores newlines and other formatting) where the #declare stops 
and the center of the sphere begins.  I'm sure there are situations, 
such as in the algorithmic declaration of a triangle or a mesh, where 
such situations are either unavoidable or difficult to spot.  

The introduction of a semicolon is a bit like the introduction of a 
comma (which is still optional, but recommended) into the vector 
syntax in that the old format allowed unparseable constructs like 
<1 -2 3> which could be either a 2d or a 3d vector, depending on 
how you look at it.  

Why the parser feels the need to let us know about the problem, 
where it doesn't for commas, is anybody's guess, but I'd assume 
it's because whoever found the above problem spent a long time 
tracking it down and would prefer for the parser to do all that 
work in the future.


Post a reply to this message

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