[Dynamite] Inheritance
Ian Holmes
ihh@fruitfly.org
Tue, 7 Mar 2000 16:19:28 -0800 (PST)
Instead of all that stuff, why not just have
interface Base { void foo(); }
interface Derived : Base { void bar(); }
mapping to
struct Base { .... };
struct Derived { struct Base inherited_Base; .... };
void Base_foo (struct Base* b) { .... };
void Derived_foo (struct Derived* d) { Base_foo (&d->inherited_Base); }
void Derived_bar (struct Derived* d) { .... };
It means we have to write a Derived_foo() wrapper function, but it saves
us a lot of pointers-to-functions.
--
Ian Holmes .... Howard Hughes Medical Institute .... ihh@fruitfly.org