lua-users home
lua-l archive

Re: Recipe: setfenv with Lua 5.2.0 work3

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


> 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.
-- Roberto

AltStyle によって変換されたページ (->オリジナル) /