"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> ingo <ing### [at] tagpovrayorg> wrote:
> > i.i.r.c. there is/was a way to declare a variable in a function. But how?
> > I don't remember and can't find it in the remnants of my archive.
> You can not have variables that are local to the function. (And you can not have
> any declarations of variables inside the function that are executed when you
> call the function.) If a function is created within a macro, it can access
> variables that are local to the macro. But be aware, because the scope of
> function names are problematic and not well documented in POV-Ray.
At the end of the thread below you can find an example with an array of
functions in a macro. In that example a similar technique is used. Each
function, starting with the last one, calls the one before it until the
convergence criterion has been reached or the first function has been reached.
Date: 2003-05-02 09:53:29
Subject: Use of povray functions to make fractals other than "famous" Mandelbrot
with same scalability?
Author: Greg M Johnson
As Hans Mikelson mentioned in that thread; This is "fake" recursion.
I'm not sure if real recursive functions are now safe to use in POV-Ray.
IIRC they were at some point not safe to use and could cause POV-Ray to crash.
Post a reply to this message