[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Capturing Lua variable as a string
- From: Romulo Bahiense <romulo@...>
- Date: Mon, 01 Oct 2007 08:48:57 -0300
Oops, one mistake:
configloader2.lua
function load( filename )
local f = assert( loadfile( filename ) )
local t = {}
local old_DEF_PARAM = DEF_PARAM
local e = setmetatable(
{
DEF_PARAM = function( info )
-- In case DEF_PARAM creates another table...
info = old_DEF_PARAM( info )
t[ info ] = true
return info
end;
}, {
__index = _G;
__newindex = function( self, k, v )
if t[ v ] then
v.NAME = k
end
end;
}
)
setfenv( f, e )
f()
end
~~ end of configloader2.lua
I was also using a 't' as the name of 'self' on '__newindex'. Sorry.
--rb