home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.modula3:841 comp.lang.misc:2680 comp.lang.c++:11204
- Newsgroups: comp.lang.modula3,comp.lang.misc,comp.lang.c++
- Path: sparky!uunet!mcsun!fuug!funic!news.cs.hut.fi!news!Ari.Huttunen
- From: Ari.Huttunen@hut.fi (Ari Juhani Huttunen)
- Subject: Re: Sather's Multiple Inheritance
- In-Reply-To: mbk@lyapunov.ucsd.edu's message of 18 Jul 92 01:03:48 GMT
- Message-ID: <ARI.HUTTUNEN.92Jul20112548@wonderwoman.hut.fi>
- Sender: usenet@cs.hut.fi (Uutis Ankka)
- Organization: Helsinki University of Technology, Finland
- References: <147qlkINNft3@network.ucsd.edu>
- Date: Mon, 20 Jul 1992 09:25:48 GMT
- Lines: 33
-
- In article <147qlkINNft3@network.ucsd.edu> mbk@lyapunov.ucsd.edu (Matt Kennel) writes:
-
- ! Now what if both PARENT_CLASS_ONE and PARENT_CLASS_TWO
- ! have two features, say integer variables "count":
-
- ! Then you can use "alias new_name old_name":
- ! ===========
- ! class CHILD is
-
- ! PARENT_CLASS_ONE; --- That inherits it
- ! alias count_one count; --- rename "count" from P_C_O
- ! PARENT_CLASS_TWO; --- That inherits another
- ! alias count_two count; --- Rename that one as well
-
- ! count : INT; --- A third "count" different from the
- ! --- other two.
-
- ! end;
- ! ============
-
- ! I don't know if this solution is perfect for all circumstances, but it
- ! appears to a layman to cover a whole lot, and it's very easy to understand.
-
- You still have the problem that CHILD, PARENT_CLASS_ONE and PARENT_CLASS_TWO
- refer to the same 'count' each, unless you re-rewrite the functions in
- the parent classes. (In some cases this would be desirable, in others it
- would not.)
-
- The problem would be solved, if this were possible: 'rename count_two count'.
- --
- ...............................................................................
- Ari Huttunen They say the sky high above
- 90-7285944 is Caribbean blue... (Enya)
-