[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Explanation needed for setfenv replacement for Lua 5.2
- From: "E. Toernig" <froese@...>
- Date: Thu, 5 May 2011 00:53:34 +0200
Just for the record:
> P.S: I know that I could pass the environment as an argument to the
> anonymous closure like this:
> ------------------------------------
> lib.Interpreter( function( env )
>
> _ENV = env
> ------------------------------------
That would also change the callers env!
Either "local _ENV = env" or simply name the parameter _ENV:
lib.Interpreter( function(_ENV)
Ciao, ET.