POV-Ray : Newsgroups : povray.advanced-users : Possible win-pov bug Server Time
31 Oct 2024 21:28:41 EDT (-0400)
  Possible win-pov bug (Message 1 to 4 of 4)  
From: Andrew C on Mozilla
Subject: Possible win-pov bug
Date: 22 Jul 2004 16:16:46
Message: <410020ae$1@news.povray.org>
Well... OK... it's not Earth-shattering...

Try this:

#declare F1 = function(a, b, c, d) {a+b+c+d}
#declare F2 = function(a, b, c, d) {select(F1(a, b), a*b*c*d, a/b-c/d)}

When I try to render this scene, POV-Ray (correctly) complains. It gives 
me an error that says

"Parse Error: Invalid number of parameters: 2 supplied, 4 required!"

However... it highlights the closing bracket of the select() function, 
making it look like that is the function that has 2 parameters but needs 
4. Had me confused for about an hour before I realised that it's 
actually F1() that needs more parameters!

I don't know if this is unique to the select() function. (I would 
imagine not, but I haven't checked.)

(This is with POV-Ray "3.6.0.icl8.win32" on Windows XP - not that I 
imagine it makes much odds to this...)

Andrew @ home.


Post a reply to this message

From: Warp
Subject: Re: Possible win-pov bug
Date: 23 Jul 2004 08:17:56
Message: <410101f4@news.povray.org>
Andrew C on Mozilla <voi### [at] devnull> wrote:
> However... it highlights the closing bracket of the select() function, 
> making it look like that is the function that has 2 parameters but needs 
> 4. Had me confused for about an hour before I realised that it's 
> actually F1() that needs more parameters!

  I have noticed similar behaviour as well: Sometimes the cursor does
not jump to the place of the actual error, but somewhere completely
different in the same line.
  It might have something to do with how the parser works, or something...

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Possible win-pov bug
Date: 25 Jul 2004 09:00:39
Message: <4103aef7@news.povray.org>
In article <410101f4@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>   I have noticed similar behaviour as well: Sometimes the cursor does
> not jump to the place of the actual error, but somewhere completely
> different in the same line.
>   It might have something to do with how the parser works, or something...

In functions it it non-trivial to detect errors early because some errors
can only be determined when the function is compiled (well, there could be a
separate pass for checking, but that would make no difference).

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Andrew C on Mozilla
Subject: Re: Possible win-pov bug
Date: 28 Jul 2004 15:52:59
Message: <4108041b$1@news.povray.org>
> In functions it it non-trivial to detect errors early because some errors
> can only be determined when the function is compiled (well, there could be a
> separate pass for checking, but that would make no difference).

Yeah, that's fair enough. (I wrote a parser of my own the other day... 
If you feed it incorrect syntax, it totally crashes!)

Would it be possible to print the NAME of the function as well as the 
expected number of arguments? Doesn't help if you have nested 
invocations of it, but it's a start...

Andrew @ home.


Post a reply to this message

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