Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!news2.near.net!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!pipex!harlqn.co.uk!harlequin.co.uk!eliot
From: eliot@harlequin.co.uk (Eliot Miranda;081 519 2769)
Subject: Re: Smalltalk and Multiple Inheritance
Message-ID: <eliot.779712883@newshost>
Sender: usenet@harlequin.co.uk (Usenet Maintainer)
Organization: Harlequin Ltd, Cambridge, UK
References: <9409132338.AA06507@sci.brooklyn.cuny.edu>
Date: Fri, 16 Sep 1994 10:54:43 GMT
Lines: 52

In <9409132338.AA06507@sci.brooklyn.cuny.edu> Gerald Weiss 718-951-5945 <weiss@SCI.BROOKLYN.CUNY.EDU> writes:

>I have been collecting articles for a class on OOP and I recall
>reading a statement that multiple inheritance could be introduced
>into Smalltalk with just several pages of code. Unfortuantely I
>Can't recall where I saw the statement and I can't seem to find
>it again.

>What I wanted to know was:

>1. Does anyone have a reference to this statement.

A.H. Borning and D.H.H. Ingalls, ``Multiple Inheritance in
Smalltalk-80'', Proceedings at the National Conference on AI,
Pittsburgh, PA, 1982.


>2. Wouldn't the modification be to the interpreter as well as
>   the Behavior/Class/Metaclass classes as method searches are the
>   purvue of the interpreter? (It seems to me that to do this,
>   the superclass pointer of the class would become some form of
>   collection and the interpreter would traverse that.)

No, the Borning & Ingalls implementation depended on appropriate handling
of doesNotUnderstand:.  Outline:

	a new metaclass MetcaclassForMultipleInheritance is used to instantiate
classes which multiply inherit.  The metaclass holds the extra superclasses.
When one creates a class with multiple superclasses the compiler generates
methods in the class for all method conflicts (different implementations of
methods reachable along different superclass chains).  The programmer can
redefine these methods to resolve conflicts.  Instance variable conflicts
are not allowed.

If a message is not understood, the doesNotUnderstand: method in Object
first checks if the receiver inherits a method from one of its other
superclasses.  If so the method is 'copied down' (recompiled in the
receiver's class) and the message is resent (via perform).  Subsequent sends
find the method in the receiver's class via VM lookup.

The system must maintain dependency information so that, for example, if a 
copied down method is redefined, the now obsolete copied down method can
be removed.

There were some bugs in the system, especially in not renaming super when
copying down a method containing a super send.  These have been fixed.

The system existed in V2.0 through V2.3, but was discarded from V2.4 onwards.
--
Eliot Miranda                           email:  eliot@harlequin.co.uk
Harlequin, Barrington Hall, Barrington  Tel:    +44 223 87 3887
Cambridgeshire, CB2 5RG, UK             Fax:    +44 223 872 519
