lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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.