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

Why Single Inheritance Restriction?

This page is part of the web mail archives of SRFI 76 from before July 7th, 2015. The new archives for SRFI 76 contain all messages, not just those from before July 7th, 2015.

I would appreciate either the removal of the single inheritance restriction 
[e.g. by allowing multiple PARENT clauses] or the addition of a rational of 
why such a restriction is warrented.

My concern is that multiple inheritance has been found quite useful, while 
simulating multiple inheritance using single inheritance is typically tedious 
and error prone.

An example is an MI object system which uses records as instances (rooted at a 
common ancestor w predicate instance?).  I might desire a collection which is 
Keyed (fields: index-type, key=?, element-type), Thread-Safe (field: mutex), 
and Sorted (field: compare<?).   Such a record object would answer #t to each 
parent predicate:

(and (instance? obj) (keyed? obj) (thread-safe? obj) (sorted? obj)) => #t

Supporting MI would allow innovation in the dispatching and surface syntax of 
OO systems while allowing more portable instance representations.  Precluding 
MI leads to yet more "tagged vector" implementations and associated broken 


[Note: Fast, constant-time subtype testing: