[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua registry, environment, and threads.
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 7 Jan 2010 16:52:03 -0200
> Also, if you are deprecating setfenv, then it probably makes sense
> to add an optional second parameter to the load routines which would
> provide the environment to associate with the loaded chunk [...]
There is be another function for that, loadin. (Both 'load' and
'loadin' accept the chuck both as a function, as in 5.1, or as a
string.)
> though I guess you could do this with the new construction as:
>
> local f
> in environment do f = loadstring( code ) end
That will not work. "in" is lexical, it does not affect dynamic code
(the same way that the dynamic code cannot access local variables).
-- Roberto
- References:
- Lua registry, environment, and threads., Christian Tellefsen
- Re: Lua registry, environment, and threads., Patrick Donnelly
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy
- Re: Lua registry, environment, and threads., Christian Tellefsen
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy
- Re: Lua registry, environment, and threads., Mark Hamburg
- Re: Lua registry, environment, and threads., Patrick Donnelly
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy
- Re: Lua registry, environment, and threads., Mark Hamburg