lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
Sergey Rozhenko posted some time ago a pretty good implementation of
setfenv that handled most of those subtleties.
(http://lua-users.org/lists/lua-l/2010-06/msg00313.html)

Luiz:
Search the upvalues of the function looking for the one named _ENV.
If debug info has been stripped from the function, you're out of luck,
but that does not seem to be your case.


Thanks for the help! I'll try your suggestions.

By the way, wouldn't it be good to ease the transition to 5.2 to create a place (lua.org? wiki?) where useful "compatibility" snippets/tricks like that could be found easily?

Best Regards,

--
Lorenzo