comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: orthogonal inheritance and extension aggregates
Date: Sat, 20 Jul 2013 10:54:44 +0300
Date: 2013-07-20T10:54:44+03:00	[thread overview]
Message-ID: <b4uu25F9it4U1@mid.individual.net> (raw)
In-Reply-To: <16rbbo5ajimr0.17dwtq00njx6u.dlg@40tude.net>

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" <mailbox@dmitry-kazakov.de> 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
      .      @       .


      reply	other threads:[~2013-07-20  7:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19 17:46 orthogonal inheritance and extension aggregates Felix Krause
2013-07-19 18:00 ` Adam Beneschan
2013-07-22 16:02   ` Adam Beneschan
2013-07-22 18:44     ` Dmitry A. Kazakov
2013-07-22 18:59     ` Adam Beneschan
2013-07-22 19:19       ` Adam Beneschan
2013-07-22 22:03       ` Felix Krause
2013-07-19 19:05 ` Dmitry A. Kazakov
2013-07-20  5:49   ` Randy Brukardt
2013-07-20  6:36     ` Dmitry A. Kazakov
2013-07-20  7:54       ` Niklas Holsti [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox