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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,953e1a6689d791f6 X-Google-Attributes: gidfac41,public X-Google-Thread: fdb77,953e1a6689d791f6 X-Google-Attributes: gidfdb77,public X-Google-Thread: f79bb,953e1a6689d791f6 X-Google-Attributes: gidf79bb,public X-Google-Thread: 103376,953e1a6689d791f6 X-Google-Attributes: gid103376,public From: mernst@x4u2.desy.de (Matthias Ernst) Subject: Re: Eiffel and Java Date: 1996/11/03 Message-ID: <55irdr$hrb@dscomsa.desy.de>#1/1 X-Deja-AN: 194130422 references: <550sm2$sn1@buggy.news.easynet.net> <55562c$nkd@mulga.cs.mu.OZ.AU> followup-to: comp.lang.eiffel,comp.lang.ada,comp.lang.sather,comp.lang.java.advocacy organization: DESY newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.sather,comp.lang.java.advocacy Date: 1996-11-03T00:00:00+00:00 List-Id: Fergus Henderson (fjh@mundook.cs.mu.OZ.AU) wrote: : Suppose I have two existing library classes (perhaps supplied by different : vendors) which have some commonality, but don't inherit from a common : base class. In Sather, one can simply create a new interface and : declare these classes to be instances of this interface, without : modifying the existing code. We have seen examples how to do it in Sather, Transframe, Ada and Java(or not). These are all languages where one explicitly has to annotate in the definition of A or the one of B if A is to be subtype of B. There exist however languages (Emerald, PolyToil, Quest (not even OO), others ?) with structural subtyping which means that a type A automagically is subtype of a type B if it has a conforming interface. This introduces the possibility of 'subtyping by chance' but on the other hand eliminates the problem described above. If you want a supertype just declare it. The existing types will be substitutable for it. I wonder if anyone out there has experience with this form of type system. Though it is easier to use, does one perhaps confuse more easily the type hierachy ? -- Matthias