[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Isn't load() in 5.2 too naive about _ENV?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 5 Oct 2011 14:53:25 -0300
> So, please correct me, if I am wrong. To properly change environment
> of Lua function, that function should in general follow "_ENV is first
> upvalue" protocol. This is only guaranteed for newly compiled chunks,
> i.e. load() with source string argument, and not for string.dump'ed or
> other arbitrary chunks.
Right. Only for "main" chunks, not arbitrary functions.