Re: Flexvectors vs subtyping
Per Bothner 08 Oct 2020 17:54 UTC
On 10/8/20 10:32 AM, Adam Nelson wrote:
> with the right limitations on multiple inheritance it may even be possible to implement it on top of Kawa's JVM object system too.
Kawa implements general Common Lisp multiple inheritance (though not multi-methods),
if you use define-class rather than define-simple-class. (This is somewhat simplified.)
Field access is compiled as interface method calls.
However, the Conventional Wisdom in programming-language design suggests
that multiple inheritance (with defaults) of "types" (interfaces) is very valuable,
but inheritance (single or multiple) of "classes" (implementations) is not so useful.
I.e. Java mostly got it right, though it took until Java 8 to add default methods
for interfaces.
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/