|
![](/i/fill.gif) |
In article <3a0d7ee9@news.povray.org>, "Wlodzimierz ABX Skiba"
<abx### [at] abx art pl> wrote:
> you said about trick,
> you mean this from p.u-p ?
The "trick" was something like:
#declare Func = function {1}
#declare Func = function {if(z, Func(x, y, z-1), moof)}
> what about overdefined declaration
> with different number of parameters ?
> this could cause unexpected error
> (or expected by me in source code)
If a function calls itself with the wrong number of parameters, it
certainly should produce an error...just like any other function call.
> I think it should be possible without trick
Definitely. What I meant was that since it is already possible, it
shouldn't be very difficult to make it work without that
double-declaration trick. Maybe just creating a "dummy" function with
the same name and parameters just before parsing the body of the
function would work...
This:
#declare Func = function(r) {Func(r-1)}
Would do this:
1: Parse function parameter list
2: Create dummy function: Func = function(r){0}
3: Parse body of function: Func = function(r){Func(r-1)}
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |