[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua registry, environment, and threads.
- From: Leo Razoumov <slonik.az@...>
- Date: Sat, 9 Jan 2010 08:08:15 -0500
On 2010-01-09, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Sat, Jan 9, 2010 at 1:29 PM, steve donovan <steve.j.donovan@gmail.com> wrote:
> > debug.setfenv still works as expected in this context:
>
>
> A more idiomatic Lua 5.2 way of compiling a function-with-a-context:
>
> > in {x = 1, y = 10, loadstring = loadstring} do fn = loadstring 'return x + y' end
> > = fn()
> 11
>
Calling loadstring 'return x + y' hurts performance especially if used
multiple times. For me Lua's getfenv/setfenv was a killer feature very
useful in multiple passes over the same dataset in statistical data
analysis.
--Leo--
- 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., Enrico Colombini
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy
- Re: Lua registry, environment, and threads., Edgar Toernig
- Re: Lua registry, environment, and threads., Mark Hamburg
- Re: Lua registry, environment, and threads., Leo Razoumov
- Re: Lua registry, environment, and threads., steve donovan
- Re: Lua registry, environment, and threads., steve donovan