"Kenneth" <kdw### [at] gmailcom> wrote:
> I never realized that a macro's result-- object(FOO)-- was a global variable
> that remained 'alive' in a scene once the macro was invoked.
It has to be, since macros "spit thing out" to be used outside of the macro.
> I always thought the *entire* contents of a macro died after each use (as if
> object(FOO) was always a #local thing as well.) So in effect, the result is
> 'cached' for use later. Very interesting!
I think it depends on if you use #declare or #local.
We cover this from time to time:
I'd say probably the best way to think of a macro when dealing with variables
like this, is that it's essentially just like an include file - it's just an
encapsulated piece of code.
Calling it just re-runs the code, and if it has arguments, it just uses those
I think the argument names and values are the only thing that are temporary,
local, and get destroyed upon exiting.
Post a reply to this message