[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua registry, environment, and threads.
- From: Mark Hamburg <mark@...>
- Date: Thu, 7 Jan 2010 08:29:48 -0800
While reworking environments, is there any chance we could gain the ability to clone a function and assign it a new environment? I've wanted this when building object systems and thinking about how to wire up a super call for chained methods. There have been other times when it has seemed like it would be useful, but I haven't had enough caffeine yet this morning for them to come to me.
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 though I guess you could do this with the new construction as:
local f
in environment do f = loadstring( code ) end
Provided you capture loadstring and code into local variables before the in construct.
Mark
- 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