|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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
|
|
| |
| |
|
|
|
|
| |
|
|