[comp.lang.modula3] Multiple inheritance

siebren@rivm.nl (Siebren van der Zee) (02/21/91)

Just curious: how would multiple inheritance fit in Modula 3's type system?
I.e. suppose one could write:

    TYPE t1 = OBJECT
	METHODS
	    read(buf: Text.T);
	    write(buf: Text.T)
	END;

    TYPE t2 = OBJECT
	hip, hurray: (iene, miene, mutte);
	METHODS
	    foo(); bar()
	END;

    TYPE t3 = t1, t2 OBJECT METHODS yetAnotherMethod() END;
    VAR foo: t3;

How would a procedure that implements yetAnotherMethod be declared?
What C-code could the compiler produce to compute the address of foo.hip?
Which '<:' relations exist between t1, t2 and t3?

(There are probably syntax errors in the above code. I got just about
everything to use M3: enthusiasm, a computer. I only lack the compiler...)

	Siebren