lua-users home
lua-l archive

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


Oops...

----- Original Message ----- From: "Leandro Candido" <enclle@click21.com.br>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Saturday, February 05, 2005 3:19 PM
Subject: Re: metatable, __index & forwardInvocation?


Hello "PA",

...

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

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));
                   end
       end

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

God bless you,

Leandro.


--
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