From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 9 Feb 91 02:39:13 GMT From: mojsys!joevl@uunet.uu.net (Joe Vlietstra) Subject: LRM 4.1.3 paragraphs 17-19 Message-ID: <1991Feb09.023913.524@mojsys.com> List-Id: In article <1991Feb8.063458.850@kestrel.edu> gyro@kestrel.edu (Scott Layson) writes: >It has to do with paragraphs 18 and 19 of section 4.1.3. >(Please refer to the manual at this point.) Paragraph 17 talks >about four kinds of named constructs whose names can be used as >the prefix of an expanded name. Paragraphs 18 and 19 give >additional rules about only two of those kinds of constructs, >viz., subprograms and accept statements. What about block >statements and loop statements? > >Scott Burson >Gyro@Reasoning.COM When the LRM is unclear, check the "Approved Ada Language Commentaries" (published in ACM Ada Letters, Vol IX, No 3, 1989). For your specific problem, check commentary AI-0016. This commentary addresses prefixes for renamed packages. But the discussion section describes how to interpret 4.1.3, and ends with the statement: In short, since the Standard is unclear on the legality of such names, and since implementations tend to allow them, it is reasonable to interpret the Standard as allowing such names. When in doubt, be permissive. In the case of block statements and loop statements, the only restrictions are those imposed by the scoping rules. Variables declared within a block cannot be referenced outside of the block, even with a prefix. Loop statements implicitly declare a variable: the loop index. So the following works (but may get the programmer fired): LOOP1: for I in 1..10 loop LOOP2: for I in 1..10 loop X (LOOP1.I,LOOP2.I) := 100.0; end loop LOOP2; end loop LOOP1; But LOOP1.I cannot be referenced outside of the loop. Hope this helps. ------------------------------------------------------------------ Joe Vlietstra | Checked Daily: ...!uunet!mojsys!joevl Mojave Systems Corp | Checked Weekly: mojave@hmcvax.claremont.edu 1254 Harvard Avenue | Iffy Routing: joevl@mojsys.com Claremont, CA 91711 ! Voice: (714) 621-7372 ------------------------------------------------------------------ -- ------------------------------------------------------------------ Joe Vlietstra | Checked Daily: ...!uunet!mojsys!joevl Mojave Systems Corp | Checked Weekly: mojave@hmcvax.claremont.edu 1254 Harvard Avenue | Iffy Routing: joevl@mojsys.com