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.

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 ( wiki?) where useful "compatibility" snippets/tricks like that could be found easily?

Best Regards,