lua-users home
lua-l archive

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


On Wed, Mar 31, 2010 at 8:57 AM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> I was under the impression that we would still have debug.setfenv and
>> debug.getfenv to fill the same purpose? Now I'm hearing that functions
>> won't have environments in the language at all?
>
> >From the original proposal:
>
> * http://lua-users.org/lists/lua-l/2010-02/msg00753.html
>
>  We also came up with a new concept for environments in Lua 5.2; its
>  main merit is simplicity. Lua functions do not have environments any
>  more.
>
> -- Roberto


To quote from that e-mail
> After that long discussion about setfenv/getfenv, we are convinced
> that both functions should belong to the debug API.

So that has changed since I last visited the discussion? What will the
general approach to sandboxing be if, based on last time I tried Lua
5.2, the "in <env> do <block> end" syntax doesn't affect functions
called in that block?

~Jonathan