From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.200.202 with SMTP id ex10mr22228242qab.8.1371998408640; Sun, 23 Jun 2013 07:40:08 -0700 (PDT) X-Received: by 10.50.132.65 with SMTP id os1mr330727igb.13.1371998408444; Sun, 23 Jun 2013 07:40:08 -0700 (PDT) Path: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!j2no159125qak.0!news-out.google.com!fv2ni0qab.0!nntp.google.com!j2no1320482qak.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 23 Jun 2013 07:40:08 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.20.190.126; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 69.20.190.126 References: <69246de0-4b33-4d47-b5be-a45e8c911fb0@googlegroups.com> <9qrbs8l828t3pvgves504a8fm7o1c7tcpj@4ax.com> <91qcs81k6am9l3u3n19lj0b072lc48td69@4ax.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Ada202X: Easy to use "UML private"-like components From: Shark8 Injection-Date: Sun, 23 Jun 2013 14:40:08 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Original-Bytes: 3111 Xref: number.nntp.dca.giganews.com comp.lang.ada:182044 Date: 2013-06-23T07:40:08-07:00 List-Id: 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.