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,FREEMAIL_FROM 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,ASCII Path: g2news1.google.com!postnews.google.com!g12g2000yqd.googlegroups.com!not-for-mail From: AdaMagica Newsgroups: comp.lang.ada Subject: Re: Derived private interface Date: Wed, 6 Jul 2011 01:30:10 -0700 (PDT) Organization: http://groups.google.com Message-ID: <4b2728fc-6127-45d8-a314-9fc491701c26@g12g2000yqd.googlegroups.com> 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> NNTP-Posting-Host: 80.156.44.178 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1309941107 29696 127.0.0.1 (6 Jul 2011 08:31:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 6 Jul 2011 08:31:47 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g12g2000yqd.googlegroups.com; posting-host=80.156.44.178; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESRCNK X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20089 Date: 2011-07-06T01:30:10-07:00 List-Id: On 6 Jul., 09:55, Georg Bauhaus wrote: > On 7/6/11 6:34 AM, AdaMagica wrote: > > > I should have written > > > =A0 =A0overriding 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. In both cases, if the compiler suddenly complains when before everything was OK, something in the hierarchy below the actual type must have changed. Without those keywords, you will never be informed and will spend hours or days debugging. > Premises: > - A subprogram is an overriding subprogram in most cases. > + I.e., a subprogram following a type declaration is usually > =A0 =A0intended to override. Here, "usually" refers to OOD > =A0 =A0being =A0ubiquitous. Really? > - Idiomatic use will suggest to place non-overriding subprograms > =A0 =A0in nested packages (factories, for example). No, a non-overriding operation may well be primitive, so cannot be in a nested scope. > - Compilers will warn in any case whenever they detect > =A0 =A0a subprogram that looks suspicious. When is something suspicious for the (mind-reading) compiler?