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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a84c99b61df4f8b3,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.motzarella.org!motzarella.org!not-for-mail From: =?ISO-8859-1?Q?S=E9bastien?= Newsgroups: comp.lang.ada Subject: Overriding : a nice one for ada Date: Thu, 22 May 2008 14:44:07 +0000 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: feeder.motzarella.org U2FsdGVkX1/Mw1KgAASKrcHXOG5dpmni6Jj2pmdLQx3eqx/l0poWwOimSiU+IG4bWWy21whv6s4+LOxJaknDl6HXCT5dK881p0kQF0DREWHOGF3bXuPHED6w+W6dSdhSyl/9nlExm5r8ZwwfenQFTA== X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers NNTP-Posting-Date: Thu, 22 May 2008 14:44:12 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1+BfHhRLDzyGu/fJPr5HkydTIzRRzC9Vnue9lh5Yekf0Q== Cancel-Lock: sha1:VQk9nPPlKW+uETdKXkTjzBmI/G8= User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) Xref: g2news1.google.com comp.lang.ada:286 Date: 2008-05-22T14:44:07+00:00 List-Id: Hi, Just to share a discussion with colleagues today. Here is what one asked to us (I write in pseudo OO code) Class Bar => public test() => call testPublic; call testPrivate; public testPublic(); private testPrivate Class Foo => public testPublic(); private testPrivate(); We do not care about testPublic and testPrivate behaviour, the code is when you create a Foo object and you call test, which method is goind to be called ? PHP : Foo.testPublic and Bar.testPrivate C++ : Foo.testPublic and Foo.testPrivate Java : Foo.testPublic and Bar.testPrivate Ada : Whoever you ask because at compile time you have to say Do I override ? ("[not] overriding" keywork tell you what you are doing) : And compiler requires not overriding testPrivate and overriding testPublic ... so no more surprise In test you have to ask yourself : do I call test with Call type or Call wide-type ?, one more time, no more surprise. So in the three first languages ... that's a surprise : No compilation warning, no compilation error, just a result you have to know and a different behaviour. In Ada, no surprise, the compiler requires from you what to explicit what are going to do or doesn't compile ... There is some new adepts of Ada over here :-) Sebastien