comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: orthogonal inheritance and extension aggregates
Date: Sat, 20 Jul 2013 08:36:09 +0200
Date: 2013-07-20T08:36:09+02:00	[thread overview]
Message-ID: <16rbbo5ajimr0.17dwtq00njx6u.dlg@40tude.net> (raw)
In-Reply-To: ksd8dm$1l3$1@loke.gir.dk

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*. 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

  reply	other threads:[~2013-07-20  6:36 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 [this message]
2013-07-20  7:54       ` Niklas Holsti
replies disabled

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