From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public From: shang@corp.mot.com (David L. Shang) Subject: Re: OO, C++, and something much better! Date: 1997/01/30 Message-ID: <1997Jan30.150303.732@schbbs.mot.com>#1/1 X-Deja-AN: 213248905 sender: news@schbbs.mot.com (SCHBBS News Account) references: <32F07705.289C@concentric.net> organization: MOTOROLA reply-to: shang@corp.mot.com newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object Date: 1997-01-30T00:00:00+00:00 List-Id: In article <32F07705.289C@concentric.net> Alan Lovejoy 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