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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Overriding puzzle Date: Wed, 30 Dec 2015 17:13:21 -0600 Organization: JSA Research & Innovation Message-ID: References: <5be84c5a-9614-4ee2-ae85-beb962171a05@googlegroups.com> <192c4493-9c53-4e23-b9bd-e4c543738dbc@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1451517202 8398 24.196.82.226 (30 Dec 2015 23:13:22 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 30 Dec 2015 23:13:22 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:28944 Date: 2015-12-30T17:13:21-06:00 List-Id: wrote in message news:c63a98f4-1127-4e7d-852f-ad418a4a749f@googlegroups.com... >I do not think that that is it. I think that type custom should be declared >in a package like A is. In general, you'd be correct, but in the specific instance of a single overriding routine, you'll get the right answer in a procedure. But you can't add any new primitive operations in a subprogram, and you can't override anything after the first body (and most people will only write bodies in a subprogram declarative part). Ergo, it works fine for silly examples like this one, but it's a bad habit to get into. Randy.