[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: _G equilence in Lua 4
- From: Edgar Toernig <froese@...>
- Date: Fri, 23 Apr 2004 01:11:18 +0200
Fabricio de Alexandria wrote:
>
> What could be the equivalent code in Lua 4?
+ _G = globals()
function test()
print 'test'
end
function change( f )
table = _G
local old_fn = table[f]
table[f] = function( ... )
print "function changed"
- return (old_fn)(unpack( arg ))
+ return call(%old_fn, arg)
end end
print 'before change'
test()
print 'after change'
change ('test')
test()
Ciao, ET.