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.9 required=5.0 tests=BAYES_00 autolearn=ham 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,UTF8 Path: g2news1.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Derived private interface 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> <4b2728fc-6127-45d8-a314-9fc491701c26@g12g2000yqd.googlegroups.com> Date: Thu, 07 Jul 2011 06:37:58 -0400 Message-ID: <82vcve4bqx.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (windows-nt) Cancel-Lock: sha1:jqDzcgRdCnYNRNPr3TuPO8EGA84= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 89a4b4e158c83e029e66128205 Xref: g2news1.google.com comp.lang.ada:20113 Date: 2011-07-07T06:37:58-04:00 List-Id: AdaMagica writes: > On 6 Jul., 09:55, 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 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. > > OK, the compiler knows what it is - but the programmer perhaps > doesn't. It is a hint for the compiler to check the programmer's > intention. > > overriding: the compiler complains - oops, did I misspell the name? > non overriding: the compiler complains - oops, I thought there was an > inherited version. More importantly; oops, I changed the parent, and forgot to change the child; now the compiler warns me. If you don't put 'overriding' on all child operations, they silently become non-overriding when the parent changes. Very Bad Things Happen. -- -- Stephe