POV-Ray : Newsgroups : povray.general : recursively defined objects and memory : Re: recursively defined objects and memory Server Time
29 Jul 2024 08:16:51 EDT (-0400)
  Re: recursively defined objects and memory  
From: clipka
Date: 14 Aug 2013 15:04:14
Message: <520bd4ae$1@news.povray.org>
Am 14.08.2013 16:55, schrieb Bald Eagle:
>
>> - Macros are /always/ evaluated during parsing.
>
> I guess I didn't say or mean to imply that they weren't.
>
>> - Functions may be evaluated either during parsing or during rendering,
>> depending on the context in which they are used.
>
> And those contexts are?
> Function outside of a macro only at parse time, function inside a macro during
> parse and render?

Macros have /nothing/ to do with the time at which a function is evaluated.

I'm not sure off the top of my head whether there are exceptions, but 
the general rules are as follows:

- Actually, it is not about the time at which a /function/ is evaluated, 
but the time at which an /expression/ is evaluated.

- In any expression, variables (defined with #declare or #local) and 
macro invocations are /always/ resolved during parsing of that 
expression, no matter when the expression as a whole is evaluated.

- Expressions outside of a function{} block are /always/ evaluated as 
soon as they are parsed.

- Expressions inside the function{} block of a function definition are 
evaluated as soon as any expression is evaluated that invokes this function.

- Expressions inside any other function{} block (e.g. in an isosurface 
object, a function pigment, or some such) are evaluated during rendering.


Post a reply to this message

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