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: 103376,2bcab3f121e1e3a7 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.38.134 with SMTP id g6mr602876pbk.6.1316663041634; Wed, 21 Sep 2011 20:44:01 -0700 (PDT) MIME-Version: 1.0 Path: lh7ni2281pbb.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Optional body for nested generic Date: Wed, 21 Sep 2011 22:43:58 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <8ad3b626-8608-4561-8d8f-bf11e7e8efc0@en1g2000vbb.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1316663040 4954 69.95.181.76 (22 Sep 2011 03:44:00 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 22 Sep 2011 03:44:00 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-RFC2646: Format=Flowed; Original Xref: news1.google.com comp.lang.ada:18078 Date: 2011-09-21T22:43:58-05:00 List-Id: "Adam Beneschan" wrote in message news:8ad3b626-8608-4561-8d8f-bf11e7e8efc0@en1g2000vbb.googlegroups.com... >On Sep 20, 8:15 am, Robert A Duff wrote: ... >> However, I think the reasoning is bogus in the first place, >> although I didn't realize it at the time. [Lots of discussion of a source-based compiler model.] >> In a truly source-based program library, these problems just don't >> exist. Sure, but most Ada compilers aren't source-based! Assuming that is essentially the same as saying Ada = GNAT, and not even AdaCore really wants that situation. >I think there was a problem in Ada 83, because it had more >(apparently) concrete concepts of the program library, compilations, >recompilations, program units becoming obsolete and being removed from >the library. The Ada 95 Rationale pointed out a real problem: if a >library package specification that does not require a body has a body, >then when the specification is recompiled, the body, according to the >language rules, becomes obsolete and is removed from the library. If >you forget to submit the body for recompilation, this changes the >meaning of the program if the body contains an initialization part or >declares any tasks. So in that context, I think the new rule (that a >library package body cannot be present unless it's required) was >needed. This was NOT an implementation issue in Ada 83 -- the ACVC *required* the unit be be ignored. Janus/Ada had given an error message in this case, and I had to spend a week or so figuring out how to change our binder so that it could silently (other than a warning) drop the offending unit. And having done so, I was repeatedly bitten by programs that didn't work because some body was no longer elaborating the initialization (especially the Janus/Ada compiler). We eventually abandoned doing almost anything at elaboration time; besides this problem, we also were having a lot of trouble keeping things happening in the "right" order. Unfortunately, elaboration, at least as defined in Ada 83, seemed a lot more useful than it really was. The Ada 95 rule would have prevented most of that trouble. ... >Still, I'm not unhappy with the rule, since it can prevent accidents. >Suppose, for example, that a specification of P declares some >procedures, and the body contains the code for those procedures. Then >the user decides he wants the procedures moved somewhere else, so he >eliminates them so that P now declares only types. It's too easy to >make a mistake that causes P's body to be included in the final >executable anyway. I think it's beneficial to force the programmer to >take some action (in this case, adding a pragma) if P's body is still >supposed to be included. Yup. And having the rule gave us a good reason to get rid of the ACVC test that was causing all of the pain in the first place. I'm not sure the relaxation of the rules would have allowed that - it would have allowed automatic recompilation, but I'm not sure it would have allowed an error in that case (and it *should* be an error if it is not automatically recompiled, IMHO). Randy.