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.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,7508aa0d80b8bf66 X-Google-Attributes: gid103376,public From: "Stephane Barbey" Subject: Re: Inheritance and Polymorphism in Ada !! Date: 1999/10/15 Message-ID: <7u6p73$pgi$1@pollux.ip-plus.net>#1/1 X-Deja-AN: 536994720 References: <7u64k3$l1d$1@hiline.shinbiro.com> <3806DC34.1513E8B1@frqnet.de> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: news@ip-plus.net X-Trace: pollux.ip-plus.net 939976739 26130 195.65.4.173 (15 Oct 1999 08:38:59 GMT) Organization: Swisscom IP+ (post doesn't reflect views of Swisscom) NNTP-Posting-Date: 15 Oct 1999 08:38:59 GMT Newsgroups: comp.lang.ada Date: 1999-10-15T08:38:59+00:00 List-Id: Andreas Winckler wrote in message news:3806DC34.1513E8B1@frqnet.de... > See line 16, the type of the referenced object must be known in advance. > With "pointer.second_field :=1" the compiler fails. It seems that the > strong typing restricts the features of polyormism in Ada. Any comments? This would be illegal in all other OO languages I know of. For instance, in Java: public class A { int first_field; } public class B extends A { int second_field; } import A; import B; public class inheritance_polymorphism { public static void main(String[] args) { A pointer = new B(); pointer.second_field = 1; /* illegal */ ((B)pointer).second_field = 1; /* legal */ } } -St�phane ---- Stephane Barbey, PhD phone: +41(31)828.92.17 Paranor AG fax: +41(31)828.92.99 3046 Wahlendorf stephane@paranor.ch Switzerland http://lglwww.epfl.ch/~barbey