From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada design bug or GNAT bug?
Date: Sat, 4 Jul 2015 19:53:20 -0500
Date: 2015-07-04T19:53:20-05:00 [thread overview]
Message-ID: <mn9v61$v6v$1@loke.gir.dk> (raw)
In-Reply-To: 1myo335gjwyy3$.1bthq0cugahll.dlg@40tude.net
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:1myo335gjwyy3$.1bthq0cugahll.dlg@40tude.net...
> On Fri, 3 Jul 2015 22:11:18 -0500, Randy Brukardt wrote:
...
>> But of course that breaks privacy: T4 knows nothing about the full type
>> of
>> T3 or any private operations it may have.
>
> There are a lot of other cases where you effectively unable to derive from
> a type. Since they are not counted privacy breach, this one shouldn't
> either.
There are? I can't think of any. Ada 95 had an accessibility check, but
that's gone in more recent versions of the language.
Of course, I hardly ever use derived types other than for extension. Like
interfaces, the other uses come up so rarely that they aren't worth worrying
about. So I may have just forgotten something.
> In my view the problem is not in T4 but in T3, like in all other cases
> when
> you would not be able to derive later. So my solution would be a mandatory
> declaration of the public view as final. E.g.
>
> package P2 is
> type T3 is new T1 with private; -- Illegal, no derived types possible
> private
> type T3 is new T2 with null record;
> end P2;
>
> package P2 is
> type T3 is new T1 with private
> with Childless => True; -- Legal, this is the last public descendant
> private
> type T3 is new T2 with null record;
> end P2;
>
> Now, T4 cannot claim knowing nothing.
Fine idea for Ada 9x, but way too late nowdays. We're not going to break 50%
of the existing Ada code...
Randy.
next prev parent reply other threads:[~2015-07-05 0:53 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-20 18:55 Ada design bug or GNAT bug? Dmitry A. Kazakov
2015-06-21 2:42 ` Randy Brukardt
2015-06-21 6:47 ` Dmitry A. Kazakov
2015-06-22 17:39 ` Randy Brukardt
2015-06-22 18:16 ` Dmitry A. Kazakov
2015-06-23 11:00 ` G.B.
2015-06-23 14:27 ` Dmitry A. Kazakov
2015-06-23 11:45 ` G.B.
2015-06-23 14:30 ` Dmitry A. Kazakov
2015-07-02 22:22 ` Randy Brukardt
2015-07-03 8:02 ` Dmitry A. Kazakov
2015-07-03 17:33 ` Randy Brukardt
2015-07-03 21:34 ` Dmitry A. Kazakov
2015-07-04 3:11 ` Randy Brukardt
2015-07-04 12:14 ` Dmitry A. Kazakov
2015-07-05 0:53 ` Randy Brukardt [this message]
2015-06-22 18:27 ` Shark8
2015-06-23 11:51 ` vincent.diemunsch
2015-06-23 19:55 ` Shark8
2015-06-23 13:06 ` vincent.diemunsch
2015-06-23 14:30 ` David Botton
2015-06-23 15:57 ` Niklas Holsti
2015-06-23 16:01 ` G.B.
2015-06-23 18:05 ` David Botton
2015-06-23 19:38 ` David Botton
2015-06-23 14:38 ` Dmitry A. Kazakov
2015-06-23 16:57 ` Vincent
2015-06-23 17:15 ` Dmitry A. Kazakov
2015-06-23 19:14 ` vincent.diemunsch
2015-06-23 19:33 ` Dmitry A. Kazakov
2015-06-23 17:42 ` Jeffrey R. Carter
2015-07-02 22:06 ` Randy Brukardt
2015-07-04 1:52 ` Shark8
2015-07-04 3:24 ` Randy Brukardt
2015-07-04 11:02 ` Build-in-place semantics? (Was: Ada design bug or GNAT bug?) Jacob Sparre Andersen
2015-07-04 12:15 ` Dmitry A. Kazakov
2015-07-05 0:45 ` Randy Brukardt
2015-07-05 7:10 ` Dmitry A. Kazakov
2015-07-05 0:40 ` Randy Brukardt
2015-07-04 14:05 ` Ada design bug or GNAT bug? Bob Duff
2015-07-04 7:46 ` Simon Wright
2015-07-04 12:00 ` Björn Lundin
2015-07-05 0:48 ` Randy Brukardt
2015-07-06 12:37 ` Vincent
2015-07-06 20:05 ` Randy Brukardt
2015-07-07 8:06 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox