lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Luís Santos wrote:
Hello, People

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() ?

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.
I'm using the debug library to do this. debug.getlocal(2,2) gets me the 2nd argument to the caller, for example.