Newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!cam-news-feed3.bbnplanet.com!news.bbnplanet.com!cam-news-hub1.bbnplanet.com!howland.erols.net!newsxfer3.itd.umich.edu!chi-news.cic.net!ftpbox!mothost.mot.com!schbbs!news
From: shang@corp.mot.com (David L. Shang)
Subject: Re: OO, C++, and something much better!
Reply-To: shang@corp.mot.com
Organization: MOTOROLA 
Date: Thu, 30 Jan 1997 15:03:03 GMT
Message-ID: <1997Jan30.150303.732@schbbs.mot.com>
References: <32F07705.289C@concentric.net>
Sender: news@schbbs.mot.com (SCHBBS News Account)
Nntp-Posting-Host: 129.188.128.126
Lines: 33
Xref: glinda.oz.cs.cmu.edu comp.lang.c++:244369 comp.lang.smalltalk:50481 comp.lang.eiffel:18000 comp.lang.ada:56873 comp.object:60592

In article <32F07705.289C@concentric.net> Alan Lovejoy  
<alovejoy@concentric.net> writes:
> 
> And I agree that the way static typing is done in Ada, Modula-3
> and Eiffel is quite superior to what C++ does. But I would be even
> happier with the way Ada or Eiffel handle typing if one could 
> simultaneously have two different variables whose static type
> constraint is "Dictionary" but where each is actually an instance 
> of a different class (say HashTable and BinaryTree)--and the only
> class they both have in common in their inheritance hierarchy is
> Object.
> 

The problem with the languges mentioned above is that the type
system supports only a one-way inheritance, and actually we
sometiimes need a reverse inheritance: from existing subclasses
to superclass.

Your "HashTable and BinaryTree" to "Dictionary" is a good example.

In Transframe, you can simply declare:

	class Dictionary is super HashTable, BinaryTree;

Then the class Dictionary (a superclass) inherits all the common
interfaces of HashTable and BinaryTree.

The superclass construct can do something more. For example,
a safe union type, a signature, etc. For detail, refer to
http://www.transframe.com/ at "Forum/SoftwarePatterns" page.

David Shang

