|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |