lua-users home
lua-l archive

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


----- Original Message ----- From: "Leandro Candido" <>
To: "Lua list" <>
Sent: Saturday, February 05, 2005 3:19 PM
Subject: Re: metatable, __index & forwardInvocation?

Hello "PA",


__index = function( aTable, aKey )
    return this.forwardInvocation( aKey, ????? )

How do I retrieve the original parameters to doIt()?

use something like:

__index = function( x, y )
       local realfunc = [search for real func];
       return function(...)
                   local realfunc = realfunc;
<<<                    return(unpack(arg));
                   return realfunc (unpack(arg));

Using this you will return a temporary func. that will call the real function passing all the arguments to it.

God bless you,


No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.4 - Release Date: 1/2/2005