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,c52c30d32b866eae X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,2ea02452876a15e1 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,c52c30d32b866eae X-Google-Attributes: gid1108a1,public From: mab@dst17.wdl.loral.com (Mark A Biggar) Subject: Re: Real OO Date: 1996/03/15 Message-ID: <4icoop$kep@wdl1.wdl.loral.com>#1/1 X-Deja-AN: 142869484 references: <4i455s$ijq@watnews1.watson.ibm.com> organization: Loral Western Development Labs newsgroups: comp.lang.ada,comp.lang.eiffel,comp.object Date: 1996-03-15T00:00:00+00:00 List-Id: In article bobduff@world.std.com (Robert A Duff) writes: >In article , >Don Harrison wrote: >>Although such basic types are not explicitly defined as classes in Ada, >>they are effectively classes because their features are 'inherited' >>through subtyping and derivation. You wouldn't want to define '+' for >>every arithmetic abstraction. >Just to clarify, Ada *does* use the term "class" to refer to the set of >all integer types, for example. And you are correct that you get >inheritance for these classes -- both for predefined things like '+' and >for user-defined operations. However, you do not get type extension >(you can't add new fields to an integer type when you derive from it), >and you do not get polymorphism. And in early Ada9X drafts there was the idea of being able to write routines that took parameters like function foo(X: INTEGER'CLASS) return INTEGER; which would allow you to pass in an argument of any type derived from INTEGER, but given the type view casting rules, that didn't give you any thing that just using a conversion to INTEGER on a routine with an INTEGER formal already does and added extra complexity to the language as well, so it was droped. -- Mark Biggar mab@wdl.loral.com