[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (work4) now available
- From: David Manura <dm.lua@...>
- Date: Tue, 3 Aug 2010 08:54:40 -0400
On Tue, Aug 3, 2010 at 4:01 AM, Quae Quack <quae@daurnimator.com> wrote:
> Can this not be done like so?:
> local MOD = {}
> local _ENV = setmetatable({},{__index=function(t,k) return MOD[k] or
> _G[K] end , __newindex=function(t,k,v) MOD[k] = v end })
> return MOD
Yes, although this imposes an overhead (function call) on accessing
all globals in _G, and we ask whether it's worth it over just doing
"local M = {}; function M.foo() M.bar() end; function M.bar();
print'!' end; return M".
- References:
- Re: [ANN] Lua 5.2.0 (work4) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.2.0 (work4) now available, Florian Weimer
- Re: [ANN] Lua 5.2.0 (work4) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.2.0 (work4) now available, phlnc8
- Re: [ANN] Lua 5.2.0 (work4) now available, Jim Whitehead II
- Re: [ANN] Lua 5.2.0 (work4) now available, phlnc8
- Re: [ANN] Lua 5.2.0 (work4) now available, Quae Quack
- Re: [ANN] Lua 5.2.0 (work4) now available, GrayFace
- Re: [ANN] Lua 5.2.0 (work4) now available, James Graves
- Re: [ANN] Lua 5.2.0 (work4) now available, Jerome Vuarand
- Re: [ANN] Lua 5.2.0 (work4) now available, David Manura
- Re: [ANN] Lua 5.2.0 (work4) now available, Quae Quack