[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Recipe: setfenv with Lua 5.2.0 work3
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 16 Jun 2010 15:49:46 -0300
> Cool. Now, since setfenv is totally possible, I like the _ENV :)
> Here are my implementations of setfenv and getfenv:
As far as I can see, the only missing detail of these functions (except
for occasional bugs) to achieve 100% compatibility is the case of
'getfenv' over a function that does not have an _ENV variable (that is,
it uses no globals).
We could use a weak table to keep the environments of these functions
when set by setfenv, but that still misses the case of a function
without _ENV that was not subjected to setfenv.