[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Locals in Lua Environments
- From: Stefan Brantschen <sbr@...>
- Date: Tue, 29 May 2007 06:52:15 +0200
On 29 May 2007, at 00:21, Tim Hunter wrote:
Under the risk of sounding stupid, just a curiosity: is there any
reason I should not be able to access the function arguments when
I access the function environment via getfenv() ?
I'm using the debug library to do this. debug.getlocal(2,2) gets me
the 2nd argument to the caller, for example.
My guess would be that this is some colateral effect of the
paremeters being local.
I have no doubt that the argument variables should be local - so
they won't collide with global environment. But when I am
accessing my caller's environment from another function, the lack
of access to his arguments looks kinda strange to me.
But note that this is not recommended as "usual programming tool", ie
for anything else but debugging and such.
=> PIL II chapter 23