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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,cb04cee6116c8ced X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!138.195.8.3.MISMATCH!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Package's private parts and protected types Date: Tue, 9 Feb 2010 20:29:59 -0600 Organization: Jacob Sparre Andersen Message-ID: References: <7ff3810f-3ee3-4f39-a54c-933ad7d0655c@36g2000yqu.googlegroups.com> <1v2la97s2yyvd.1rcy0ana8mver.dlg@40tude.net> <3bb38996-47f7-4f30-8255-f011501404b5@b10g2000yqa.googlegroups.com> <1qttzk1jbh24i$.xid2h7me3oec.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1265769000 21285 69.95.181.76 (10 Feb 2010 02:30:00 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 10 Feb 2010 02:30:00 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news1.google.com comp.lang.ada:9062 Date: 2010-02-09T20:29:59-06:00 List-Id: "Robert A Duff" wrote in message news:wccy6j2mpa0.fsf@shell01.TheWorld.com... > AdaMagica writes: > >> OK, but then you have a similar problem to Ada83's syntactically >> unneeded bodies which Ada95 solved with a pragma. > > I think that problem is an illusion. There was a problem, > but it was a problem with implementations, not with the > language. How do we know if a given package spec has > a body? Simple: look on the disk and see if there's > a source file containing that body. In GNAT, that would > mean looking for foo.adb. I think you're forgetting how this happens in practice. And the actual problem with Ada 83, which was that a unneeded unit with an error had to be ignored when linking. (The ACVC used to insist on that.) Ada surely needed a fix to that problem, and it wasn't one with the implementations -- at least not until they were changed to match the ACVC. (I remember doing that in Janus/Ada, it was a lot of work and it made things worse for users. Wonderful.) Moreover, it is easy to imagine errors that would cause the unit to no longer be the body (such as misspelling the name, or misspelling "body"), at which point the implementation would have to guess. But the problem of a body that the programmer expected to be included being left out would continue. So while I don't doubt that implementations could have reduced the problem (in the absense of the ACVC test - the main thing I wanted from Ada 95 was to change the rules enough to repeal that stupid test!), they couldn't have fixed it completely. Surely the same dynamic would occur for a separate private part. I'm also dubious of the basic idea. I suppose you could keep the private part in a separate file, but I can't imagine any useful way to *compile* it separately (you'd have to have both parts available in order to do any sort of code generation). So there wouldn't be much, if any, advantage in terms of development. (For Janus/Ada, at least, every source file is compiled separately, and code is generated as necessary without needing anything other than direct semantic dependencies to have been previously compiled. That model is impossible for separate private parts; the specification would not contain enough information to generate any code or any code for calls to it.) Randy.