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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: orthogonal inheritance and extension aggregates Date: Sat, 20 Jul 2013 08:36:09 +0200 Organization: cbb software GmbH Message-ID: <16rbbo5ajimr0.17dwtq00njx6u.dlg@40tude.net> References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: R0SnWoufDrgXLosLSQbuFw.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: news.eternal-september.org comp.lang.ada:16446 Date: 2013-07-20T08:36:09+02:00 List-Id: On Sat, 20 Jul 2013 00:49:41 -0500, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:igo2b70i4ox.t5duix9weguc$.dlg@40tude.net... > ... >> P.S. I don't know if Ada 2012 silently inherits from null extension. I >> heard that there was an intention to add the kludge. Though semantically >> broken it would save programs like yours. > > That's actually an Ada 2005 feature - see 3.9.3(4/2). One that I was against > because it introduces a maintenance problem (null extensions tend to turn > into non-null extensions over time, and once that happens, the feature stops > working). Right. > It appears that GNAT failed to properly implement this feature in the case > described by the OP. But the extension is null only *privately*. How can a public declaration of the overriding depend on private declaration? It looks totally crazy to me. > OTOH, as soon as the OP starts adding components to the extension, they'll > have the problem again. (I don't think it is practical to extend the > predefined containers, particularly because it's impossible to derive a > cursor type to go with the extended container -- so you either end up with > broken typing or you have do everything twice. And there are a lot of > functions that have to be overridden.) Maintaining parallel types hierarchies is a big type system problem, which is unclear how to resolve. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de