comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: Ada202X: Easy to use "UML private"-like components
Date: Sun, 23 Jun 2013 07:40:08 -0700 (PDT)
Date: 2013-06-23T07:40:08-07:00	[thread overview]
Message-ID: <f4d00f07-6220-464b-982e-cd7b67169ad6@googlegroups.com> (raw)
In-Reply-To: <wccmwqhkm22.fsf@shell01.TheWorld.com>

On Sunday, June 23, 2013 7:12:53 AM UTC-6, Robert A Duff wrote:
> 
> 
> On the other hand, the private part kludge wouldn't be so bad if
> the syntax were different:

Perhaps something like this?

Package Example is
   Type Opaque is private;
private
   Type Opaque is separate COMPLETE_NAME;
   -- This flags to the compiler that the full type appears in the
   -- package body (as COMPLETE_NAME) and the public 'Opaque' is
   -- actually a pointer/reference/(not null access) to COMPLETE_NAME,
   -- also any primitive ops for Opaque are transitively private ops 
   -- of COMPLETE_NAME.
end;


>  The private part should be a separate
> syntactic compilation_unit, with its own with clauses, and should
> normally be stored in a separate source file from the visible part.

I don't know. Certainly for consistency's sake yes, but getting compiler writers to implement that as well might have been a death-knell for Ada 83.
Moreover, we would need some way to flag there isn't a PRIVATE area, like PRIVATE IS NULL; (Or conversely have the private section optionally in the spec, as it is now, but with PRIVATE IS SEPARATE as the trigger for an external private section.)


> There's an awful lot of horrible code duplication caused by the
> fact that the private part is in the same file as the visible part.

I'm not sure about that. Consider this:
Type K;

Type J is record
 Item : K; -- might need to be access K.
end record;

Type K is new Integer Range 0..100;

Sure "Type K" appears twice, but that's required so that we have some name for the type of J.Item. The items (full declarations) in the PRIVATE section are likewise.


  parent reply	other threads:[~2013-06-23 14:40 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
2013-06-24 20:07                 ` Randy Brukardt
2013-06-23 14:40               ` Shark8 [this message]
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