lua-users home
lua-l archive

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


> 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