home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.modula3
- Path: sparky!uunet!mcsun!Germany.EU.net!Urmel.Informatik.RWTH-Aachen.DE!schumann!pk
- From: pk@rwthi3.informatik.rwth-aachen.de (Peter Klein)
- Subject: Re: Proposed langauge changes / MI
- Message-ID: <1992Jul23.122324.5310@Urmel.Informatik.RWTH-Aachen.DE>
- Sender: news@Urmel.Informatik.RWTH-Aachen.DE (Newsfiles Owner)
- Nntp-Posting-Host: schumann
- Reply-To: pk@rwthi3.informatik.rwth-aachen.de
- Organization: Lehrstuhl fuer Informatik III, RWTH Aachen, Germany
- References: <MOSS.92Jul18115425@ibis.cs.umass.edu>
- Date: Thu, 23 Jul 92 12:23:24 GMT
- Lines: 51
-
- In article 92Jul18115425@ibis.cs.umass.edu, moss@cs.umass.edu (Eliot Moss) writes:
- >Peter suggests that if D inherits from B and C, then B and C must share a
- >common ancestor A. This condition is trivially satisfied - ROOT is the
- >anscestor of all OBJECT types. Peter, I think perhaps you have a different and
- >stronger condition in mind. Could you try to articulate it? I don't think
- >requiring B and C to have the same immediate ancestor is general enough, and I
- >think saying they have to have a common ancestor other than ROOT requires more
- >defense -- MI ought to allow one to combine completely orthogonal types if
- >that's useful, shouldn't it? Why is it wrong to do so? You seem to have a
- >style or idiom in mind that I have not been able to derive from what you've
- >said so far ....
- >--
- >
- > J. Eliot B. Moss, Associate Professor
- > Department of Computer Science
- > Lederle Graduate Research Center
- > University of Massachusetts
- > Amherst, MA 01003
- > (413) 545-4206, 545-1249 (fax); Moss@cs.umass.edu
-
- Excuse me for being unclear. (I obviously haven't had my best day when I wrote
- that article anyway :).
-
- Well, although you're questions seem to be a little bit rhetorical: yes, I
- actually meant *direct* subclasses. To put it in other words: I would agree
- to MI if it is restricted to very simple fork/join situations. Furthermore,
- I think that all data from the common superclass should be shared.
-
- If you want to combine orthogonal classes, you actually build the cartesian
- product of these classes. If I'm not completely wrong, this is exactly what
- RECORDs are good for. So, if B and C are independent, I would combine these
- using A = OBJECT b: B; c: C; END.
-
- I'm totally aware of the fact that this is a little bit awkward for the people
- used to MI from other languages, because you have to copy and merge B and C's
- interfaces to get an interface for A. But it *can* be done. On the other hand,
- if you have a (virtual in the C++ sense) superclass D and subclasses B and C
- from D, there is no way to simulate A = B, C OBJECT END with SI without loosing
- data hiding.
-
- So, my proposal is sort of a compromise. It prevents MI from getting too
- complicated - for the user as well as for the compiler/run time system. But I
- don't think it prohibits the essential point about MI.
- ---
- Peter Klein E-Mail: pk@rwthi3.informatik.rwth-aachen.de
- Lehrstuhl fuer Informatik III Tel.: +49/241/80-21320
- Ahornstrasse 55 Fax.: +49/241/80-21329
- RWTH Aachen
- D-5100 Aachen
- Germany
-
-