[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua registry, environment, and threads.
- From: Petite Abeille <petite.abeille@...>
- Date: Thu, 7 Jan 2010 22:39:15 +0100
On Jan 7, 2010, at 6:56 PM, Leo Razoumov wrote:
> What would be Lua-5.2 idioms for creating sandboxes and jails?
Perhaps something along these lines?
function Sandbox( anEnvironment, aFunction, ... )
in anEnvironment do
aFunction( ... )
end
end
function Test( anIndex )
print( anIndex, _VERSION )
end
Sandbox( {}, Test, 1 )
Sandbox( _G, Test, 2 )
> 1, nil
> 2, Lua 5.2
Just idle speculation though. Need to get used to the idea of loosing get/setfenv first :/
- References:
- Lua registry, environment, and threads., Christian Tellefsen
- Re: Lua registry, environment, and threads., Patrick Donnelly
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy
- Re: Lua registry, environment, and threads., Christian Tellefsen
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy
- Re: Lua registry, environment, and threads., Mark Hamburg
- Re: Lua registry, environment, and threads., Patrick Donnelly
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy
- Re: Lua registry, environment, and threads., Leo Razoumov