From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada202X: Easy to use "UML private"-like components
Date: Tue, 25 Jun 2013 14:06:03 -0500
Date: 2013-06-25T14:06:03-05:00 [thread overview]
Message-ID: <kqcpms$kn8$1@loke.gir.dk> (raw)
In-Reply-To: 12c0h7muc9ab1$.1rn058nrhw3m8.dlg@40tude.net
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:12c0h7muc9ab1$.1rn058nrhw3m8.dlg@40tude.net...
> On Mon, 24 Jun 2013 15:11:11 -0500, Randy Brukardt wrote:
>
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
>> news:k32sqc8hss4r$.14d3n8qneksz7$.dlg@40tude.net...
>> ...
>>> Maybe they could be augmented in order to deal with more complex kinds
>>> of
>>> parametrization, e.g. for container types (sequence of Integer indexed
>>> by
>>> String). But again, please, without opening up the bodies.
>>>
>>> You don't need the body unless you "expand".
>>
>> You don't need the body even if you *do* "expand" (as Ada does). The Ada
>> contract model is strict enough that universal code sharing works (and
>> the
>> contract model could be stronger still).
>
> Here is a logical contradiction. If the model were that strong you would
> need no bodies to look into, the public part declaration should be enough
> for using the type.
I'm not talking about the public part only; I'm definitely including the
private part as well.
> But the model is not enough strong and it is not enough precise. You can
> write
>
> type T is private;
>
> and there is no contract put on T'Size. Without that contract you cannot
> have
>
> type A is array (...) of T;
Of course you can have that. Janus/Ada uses universal code sharing, so if T
is a formal private type, you have precisely this situation -- and it works
fine. The compiler simply has to insert a level of indirection; the
programmer need not know that it is there -- the compiler can manage it for
you (including all of the memory management). Just as with mutable
discriminanted records, there is no reason that the complications have to be
made visible to the programmer.
This is not done more mostly because compiler writers don't want the extra
work. They don't much care that not having these features makes more work
for the programmer, and so long as programmers don't demand this support,
they aren't going to get it. (The excuse for not providing it is that
systems that have strong verification requirements can't have the implicit
allocation and deallocation that is implied. I suppose that's true, but even
then why should the support be denied to everyone else?).
...
> 2. You must have private part available for the compiler to deduce missing
> information.
I was certainly assuming this in my original response. I'm not sure why you
thought otherwise, as I was clearly talking about in current Ada and paying
little attention to whatever Bob was talking about (it's misguided at best).
Randy.
next prev parent reply other threads:[~2013-06-25 19:06 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-21 8:43 Ada202X: Easy to use "UML private"-like components Martin
2013-06-21 9:23 ` Dmitry A. Kazakov
2013-06-21 9:33 ` Martin
2013-06-21 10:14 ` G.B.
2013-06-21 11:19 ` Martin
2013-06-21 14:51 ` Dmitry A. Kazakov
2013-06-22 11:16 ` Martin
2013-06-22 12:10 ` Dmitry A. Kazakov
2013-06-21 18:36 ` Robert A Duff
2013-06-22 16:41 ` Niklas Holsti
2013-06-22 19:05 ` Dennis Lee Bieber
2013-06-22 22:57 ` Niklas Holsti
2013-06-23 3:26 ` Dennis Lee Bieber
2013-06-23 7:32 ` Niklas Holsti
2013-06-23 13:12 ` Robert A Duff
2013-06-23 14:06 ` Dmitry A. Kazakov
2013-06-23 15:15 ` Robert A Duff
2013-06-23 18:52 ` Dmitry A. Kazakov
2013-06-23 23:38 ` Robert A Duff
2013-06-24 7:16 ` Dmitry A. Kazakov
2013-06-24 20:11 ` Randy Brukardt
2013-06-25 7:21 ` Dmitry A. Kazakov
2013-06-25 19:06 ` Randy Brukardt [this message]
2013-06-24 20:07 ` Randy Brukardt
2013-06-23 14:40 ` Shark8
2013-06-23 15:28 ` Robert A Duff
2013-06-23 18:14 ` Bill Findlay
2013-06-23 23:43 ` Robert A Duff
2013-06-23 23:48 ` Bill Findlay
2013-06-24 20:16 ` Randy Brukardt
2013-06-24 20:05 ` Randy Brukardt
2013-06-25 1:09 ` Robert A Duff
2013-06-25 19:37 ` Randy Brukardt
2013-06-23 12:28 ` Robert A Duff
2013-06-24 20:20 ` Randy Brukardt
2013-06-24 21:40 ` Niklas Holsti
2013-06-25 0:43 ` Robert A Duff
2013-06-25 19:23 ` Randy Brukardt
2013-06-25 19:19 ` Randy Brukardt
2013-07-09 11:24 ` Martin
2013-07-09 14:39 ` Simon Wright
2013-07-10 7:03 ` Martin
2013-07-09 21:43 ` Robert A Duff
2013-07-10 6:34 ` Martin
2013-07-10 8:24 ` Dmitry A. Kazakov
2013-07-10 13:06 ` Martin
2013-07-10 16:12 ` Simon Wright
2013-07-10 18:22 ` Martin
2013-07-10 19:41 ` Simon Wright
2013-07-11 18:28 ` Martin
2013-07-11 19:37 ` Simon Wright
2013-07-11 20:43 ` Martin
2013-07-12 6:57 ` Simon Wright
2013-07-12 8:05 ` Martin
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox