comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada202X: Easy to use "UML private"-like components
Date: Tue, 25 Jun 2013 09:21:12 +0200
Date: 2013-06-25T09:21:12+02:00	[thread overview]
Message-ID: <12c0h7muc9ab1$.1rn058nrhw3m8.dlg@40tude.net> (raw)
In-Reply-To: kqa94v$aoi$1@loke.gir.dk

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.

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;

etc.

Either 

1. The contract model should be much more precise and explicit, e.g. with
interfaces:

                                                    -- Not Ada
   type T is new Abstract_Fixed_Size_Type_Interface with private;
   overriding function "'Size" (Object : T) return Universal_Integer;

or

2. You must have private part available for the compiler to deduce missing
information.

I prefer both.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2013-06-25  7:21 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 [this message]
2013-06-25 19:06                             ` Randy Brukardt
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