[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Converting setfenv getfenv to Lua 5.2
- From: Coda Highland <chighland@...>
- Date: Sat, 30 Nov 2013 10:04:43 -0800
On Sat, Nov 30, 2013 at 9:33 AM, Georgios Petsagourakis
<petsagouris+lual@gmail.com> wrote:
> In this I assume you mean something like this:
> local function something(env, ...)
> local old_env = _ENV
> _ENV = env
> -- do code here, `env` is your environment
> _ENV = old_env
> end
No, not at all. _ENV isn't a global -- it's a local.
/s/ Adam