

"moocow" <nomail@nomail> wrote:
> What if I want to define a function as a sum of other functions?
There is nothing preventing you from doing it.
> #declare X = array[N]
> //set X's
>
> #declare f = function{ sum(i, 0, N1, pow(.5, pow( vlength(<x,y,z>  X[i]),
> 2))) }
>
> I can't think of how to make that work.
RTFM.
> Also, why these restrictions?
Why is the sky blue? The primary use for functions is in isosurfaces,
functions are not a macro replacement.
> Why can't I sum outside a function or
The SDL supports means to compute the sum via a macro.
> use arrays inside?
Arrays exist while parsing, functions are evaluated while rendering.
Functions are not macros!
> Why can't I do:
> #define f1 = function { f1(x,y,z) + g(x,y,z) }
> ?
This cannot work as it creates an infinite recursion!
Post a reply to this message

