[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: unified methods
- From: "Peter Prade" <prade@...>
- Date: Thu, 29 Nov 2001 11:05:44 +0100
> function gettable_event (table, index)
> return function(self,...) call(self[%index],arg) end
> end
>
> which is equal to:
> call(o["f"],{...})
oops, i lost the self as first parameter with my example.
change the gettable_event to return this instead:
return function(self,...) self[%index](self,unpack(arg)) end
then
o:f(...)
which is expanded to:
methods(o).f(o,...)
becomes:
o["f"](o,...)
(which now really is what you want for backwards compatibility)
Cheers,
Peter