[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua 5.2 - emulation of old setfenv
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Wed, 05 Jan 2011 19:35:20 +0100
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 (lua.org? wiki?) where useful "compatibility" snippets/tricks
like that could be found easily?