[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua5 local scoping
- From: "Deneb aka Alpha Cygnus" <alpha_cygnus@...>
- Date: Sun, 1 Jun 2003 22:31:52 +0400
thanx :) might be I'll dive some into the Lua source to see it all for
myself.
----- Original Message -----
From: "Wim Couwenberg" <w.couwenberg@chello.nl>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Sunday, June 01, 2003 10:20 PM
Subject: Re: Lua5 local scoping
> > Does this mean,
> > that the VM code is somehow altered for the function that goes out of
> > scope?
>
> Functions that are exported out of (and hence survive) a scope you mean.
>
> No, not the VM code itself changes, only a pointer to where the value
> resides. (Being a stack slot or the private structure value. This pointer
> is in fact part of this private upvalue structure.) Lua byte code always
> remains unchanged. Only local values, upvalues, table entries (including
> the global environment), metatables and closure environments can be
changed.
> (From Lua scripts that is, the C API can change userdata as well.)
>
> Bye,
> Wim
>
>
>