[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: setfenv/getfenv
- From: Renato Maia <maia@...>
- Date: Tue, 12 Jan 2010 19:35:50 -0200
On 12 Jan 2010, at 19:02, Leo Razoumov wrote:
--code inside the chunk:
local mt_saved= getmetatable(_G)
You should make '_G' point to the actual table containing the global
variables instead of the proxy table.
Please, note that here one cannot use __metatable trick to disable
access to the metatable. Ability to update __index/__newindex is
needed to setup proxy table for calling the chunk in other
compartments.
The '__metatable' trick does not prevent you from saving a reference
for the metatable and use it to change the '__index'/'__newindex'
fields.
--
Renato Maia
Computer Scientist
Tecgraf/PUC-Rio
__________________________
http://www.inf.puc-rio.br/~maia/
--
Renato Maia
Computer Scientist
Tecgraf/PUC-Rio
__________________________
http://www.inf.puc-rio.br/~maia/
- References:
- setfenv/getfenv, Roberto Ierusalimschy
- Re: setfenv/getfenv, Nicolas
- Re: setfenv/getfenv, Luiz Henrique de Figueiredo
- Re: setfenv/getfenv, Francesco Abbate
- Re: setfenv/getfenv, Nicolas
- Re: setfenv/getfenv, Roberto Ierusalimschy
- Re: setfenv/getfenv, Leo Razoumov
- Re: setfenv/getfenv, Roberto Ierusalimschy
- Re: setfenv/getfenv, Leo Razoumov
- Re: setfenv/getfenv, Roberto Ierusalimschy
- Re: setfenv/getfenv, Leo Razoumov