Can class.inherit be redone via superloading?
Moderator: Moderator
Can class.inherit be redone via superloading?
I'm working on updating my Telepathy Enhancement addon for v1.0 and changing it to a ToME-style interface for mod.class.Actor in the process. This means Actor needs to inherit the new class. Can I re-call the function returned by class.inherit() with my new interface class appended to the old base class list? Or must I overload Actor.lua to make the change?
Re: Can class.inherit be redone via superloading?
You must *superload* Actor, not overload it.
In the next version you will be able to call "_M:importInterface" to do exactly what you wish; but for now just place your functions inside Actor directly.
This is what importing the interface does anyway
In the next version you will be able to call "_M:importInterface" to do exactly what you wish; but for now just place your functions inside Actor directly.
This is what importing the interface does anyway
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

Re: Can class.inherit be redone via superloading?
Good enough. I thought it was doing something tricky with metatables. A closer look reveals otherwise. Thanks for the quick response.
Re: Can class.inherit be redone via superloading?
Yeah most methods are directly cached to speed up method lookup
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
