No, LK has nor real support for multiple inheritance, however, you can simply copy functions and properties from one class to another (note that $super, instanceof, etc. will not work correctly). LK uses this for Trait-like constructs. E.g. look at NetRequestReporterTrait in Network.js and it where it is used.

Object.subclass('ClassA', {
        m1: function() { return 1},
        m2: function() { return 2},
});
Object.subclass('ClassB', {
        m2: function() { return 22 },
        m3: function() { return 3 }
});
ClassA.subclass('ClassC', ClassB.prototype);

x = new ClassC();
x.m1() // 1
x.m2() // 22
x.m3() // 3
x instanceof ClassA // true
x instanceof ClassB // false


Robert



On Apr 26, 2009, at 1:58 PM, Haowei Ruan wrote:

Hi, does anyone know if Lively Kernel provide any support to
facilitate multiple inheritance ?

cheers,
Haowei
_______________________________________________
General mailing list
[email protected]
http://livelykernel.sunlabs.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://livelykernel.sunlabs.com/mailman/listinfo/general

Reply via email to