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: border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: orthogonal inheritance and extension aggregates Date: Sat, 20 Jul 2013 10:54:44 +0300 Organization: Tidorum Ltd Message-ID: References: <16rbbo5ajimr0.17dwtq00njx6u.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Trace: individual.net q807fwP7czhSOFyI9ILDPwslmWuff8iAGuQgFpsA6HB9TKyrvx Cancel-Lock: sha1:RBA17Jvt9JBZldZKk8SRiddCI5I= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 In-Reply-To: <16rbbo5ajimr0.17dwtq00njx6u.dlg@40tude.net> X-Original-Bytes: 2758 Xref: number.nntp.dca.giganews.com comp.lang.ada:182606 Date: 2013-07-20T10:54:44+03:00 List-Id: On 13-07-20 09:36 , Dmitry A. Kazakov wrote: > 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*. The *private* extension looked non-null to me in the original post, where an ellipsis marks the extension in the private part of the generic: On 13-07-19 20:46 , Felix Krause wrote: > I try to implement some feature via orthogonal inhertance like this: > > generic > type Parent (<>) is abstract tagged private; > package Extension is > type Extended is abstract new Parent with private; > > -- operations of the extended type here > private > type Extended is abstract new Parent with record > -- … > end record; > end Extension; The visible extension to a non-abstract type was null: > type Child is new Base.Extended with null record; It seems to me that GNAT is working correctly on this code, assuming that the private extension is not null. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .