lua-users home
lua-l archive

metatable, __index & forwardInvocation?

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


Hello,
I would like to be able to "forward invocations" when an object doesn't implement a given method. My objects are defined as tables of functions, which are usually invoked like this:
anObject.doIt( true )
'anObject' being a table. 'doIt' a function. And 'true' a parameter.
If the 'anObject' table doesn't have a 'doIt' key, I can most likely catch this with metatable __index... but... how do I get the original parameters so I can build an alternative invocation to dispatch somewhere else?
TIA!
Cheers
--
PA, Onnay Equitursay
http://alt.textdrive.com/

AltStyle によって変換されたページ (->オリジナル) /