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: 103376,12c1e4936587932e X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!feeder.news-service.com!newsfeed-fusi2.netcologne.de!news.netcologne.de!newsfeed-hp2.netcologne.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: overriding in private part Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <45b4a4cc-13f5-4175-9061-9c962e32d762@64g2000hsm.googlegroups.com> <47e26a8d-d104-46c5-b841-667f6e556792@w7g2000hsa.googlegroups.com> Date: Sun, 5 Oct 2008 09:35:52 +0200 Message-ID: <1vlrayvqx3imy.cp250cnppen5.dlg@40tude.net> NNTP-Posting-Date: 05 Oct 2008 09:35:54 CEST NNTP-Posting-Host: f977be98.newsspool2.arcor-online.net X-Trace: DXC=]U^K[9nC[C_cHPTNZh_e7QA9EHlD;3YcR4Fo<]lROoRQ4nDHegD_]RU`L16\j6cFcUDNcfSJ;bb[UIRnRBaCd On Sat, 04 Oct 2008 15:47:04 -0400, Robert A Duff wrote: > If you use a compiler that warns on missing "overriding", then you don't > need to say "not overriding", because that's the default -- any > subprogram that doesn't say "overriding" is not overriding. > Saying "not overriding" is just noise. [...] > I agree that if you want an indicator on every subprogram declaration, > then forbidding "no overriding" on some non-overriding subprograms is a > language design mistake. But I don't want that -- I want a safe > (non-overriding) default. But non-overriding is unsafe. Taking your example with in and in-out, when the programmer uses in instead of in-out, that does not change the program semantics, so long the program remains legal. Otherwise (if the body actually changes the parameter) it will not compile. This is safe. Now, if a procedure is not overriding where an overriding was meant, that is a semantic change of an unpredictable damage, which slips undetected through [*]. I think that actually the opposite case is safer. Let the procedure is an occasional overriding. That does not influence any type-specific code, because no dispatch happens there. It changes only the semantics of class-wide code written in terms of parent classes. There seems to be no safe default. --------- * Unless the operation is abstract -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de