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: 103376,2ea02452876a15e1 X-Google-Attributes: gid103376,public From: pitre@n5160d.nrl.navy.mil (Richard Pitre) Subject: Re: Real OO Date: 1996/03/15 Message-ID: <4icdmc$fef@ra.nrl.navy.mil>#1/1 X-Deja-AN: 142910779 references: organization: Naval Research Laboratory newsgroups: comp.lang.ada 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. > > - Bob I'm just learning Ada and I don't understand what you mean by "can't add new fields ...". Does this mean that when you subclass a built in integer type that you can only add new methods but no new instance variables? richard