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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3a096b168ebeb84 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Ada95 Package Bodies: Required? Date: 1996/05/02 Message-ID: #1/1 X-Deja-AN: 152625447 references: <3188DE77.41C6@cliffy.lfwc.lockheed.com> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-05-02T00:00:00+00:00 List-Id: In article <3188DE77.41C6@cliffy.lfwc.lockheed.com>, Matt Hembree wrote: > "Guideline 8: All library unit packages must have bodies, > even if such bodies are empty." This is probably based on an earlier version of Ada 9X, which required a body for every library package. > "28. Library Package Bodies Illegal if not Required" and > > "In Ada95, it is illegal to providea body for a library > package that does not require one." This is correct. The rule was changed during the design of Ada 9X, in order to increase upward compatibility. You should simply obey the Ada 95 rule in your Ada 83 code: make a package body if and only if you have a package that requires a body (e.g. because it contains a procedure that needs a body). If you want a body that's not otherwise required, you can put something in the spec that makes the body mandatory. For example: package P is A: array(Character) of Character; -- No subprograms here. private type Require_Body; end P; package body P is type Require_Body is record null; end record; begin for I in A'Range loop A(I) := To_Upper(I); end loop; end P; This is a good idea in Ada 83 anyway, since without the Require_Body, you might forget to recompile P's body, and many compilers will then silently omit the initialization of A. If you're writing Ada 83 code, it's also a good idea to compile it with an Ada 95 compiler once in a while, even if there's no Ada 95 compiler for your target, just to catch any possible incompatibilities. There aren't very many -- Ada 95 is *very* close to being purely upward compatible with Ada 83. The only one I've noticed in any real code is the fact that type Character changed from 7-bit Ascii to the 8-bit ISO standard. In practise, there are more incompatibilities between any two Ada 83 compilers, than between Ada 83 and Ada 95. - Bob