POV-Ray : Newsgroups : povray.text.tutorials : Summing over indices of an array : Re: Summing over indices of an array Server Time
20 Sep 2021 08:10:19 EDT (-0400)
  Re: Summing over indices of an array  
From: moocow
Date: 3 Jan 2006 01:10:00
Message: <web.43ba14da4b45696074508c90@news.povray.org>
> RTFM.

I couldn't find that in the documentation. Could you give me a link?


> Arrays exist while parsing, functions are evaluated while rendering.
> Functions are not macros!

Thanks.

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

Only if you assume functions are evaluated lazily, and don't unroll all
function references into a closed form. Apparently that's how POV works.

For all I knew, it could be the same as with scalar values:
#define f = function(x) { x }
//f(x) = x
#define f = function(x) { f(x) + 1 }
//f(x) = x+1


Post a reply to this message

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