[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: "Require" in a sandboxed environment
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 13 Aug 2007 21:42:02 -0300
> You can see that _G and the current environment are the same thing by
> doing this:
To be more exact, _G *starts* holding the current environment, but it's not
automatically updated when you change the environment:
> a=1
> print(a,_G,getfenv())
1 table: 0x8066b08 table: 0x8066b08
> setfenv(1,{a=2,getfenv=getfenv,print=print})
> print(a,_G,getfenv())
2 nil table: 0x806b8f0
--lhf