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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,158ce2376534c35d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Derived private interface Date: Wed, 6 Jul 2011 18:36:26 +0200 Organization: cbb software GmbH Message-ID: <11qlmyc4ly1lg$.dp504s2zxtor.dlg@40tude.net> References: <27656578-65aa-48b9-9f89-4ebd4e0cb02a@glegroupsg2000goo.googlegroups.com> <0fe3b0f8-c064-444d-899d-640e891b58c3@w4g2000yqm.googlegroups.com> <128d8eb5-1cc6-47e3-a09b-b53a5ef289ce@m10g2000yqd.googlegroups.com> <4e141501$0$6629$9b4e6d93@newsspool2.arcor-online.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: twQPQvOQDaMrmNwKry97mQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:20096 Date: 2011-07-06T18:36:26+02:00 List-Id: On Wed, 06 Jul 2011 09:55:44 +0200, Georg Bauhaus wrote: > On 7/6/11 6:34 AM, AdaMagica wrote: >> I should have written >> >> overriding procedure Doit (X: access Derived_Class); > > Instead of sprinkling the program with overriding indicators, > shouldn't it be normal for a compiler to detect the status of > a subprogram WRT overriding? It does. In Ada 95 there were no "overriding" qualifiers. > (It is, I think, and not just in > Ada.) Consequently, programmers would mark the opposite case. > They'd write "not overriding" only if a subprogram is really > intended to not be overriding. There are three cases actually: 1. Primitive operation 1.a. Overriding 1.b. New primitive operation 2. Free operation > - Compilers will warn in any case whenever they detect > a subprogram that looks suspicious. In order to be sure about the programmer's intent the compiler must know the class of the body being declared. Ada syntax does not provide such information, e.g. type S is new T; procedure Foo (Object : S) of T'Class; -- Overrides Foo of T'Class procedure Bar (Object : S) of S'Class; -- A new primitive operation procedure Baz (Object : S) of null; -- Free operation -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de