I've been reading the Annotated Ada Reference Manual for Ada 95, withc.l.a is unfortunately dead. You should try to post rather here:
the corrigendum (ISO/IEC 8652:1995(E) with COR.1:2000). In 8.2(11.a) it states:
I've been reading the Annotated Ada Reference Manual for Ada 95, with ||-------------------------------------------------------------------------|
the corrigendum (ISO/IEC 8652:1995(E) with COR.1:2000). In 8.2(11.a) it| states:" |
On 2026-09-29 21:02, [email protected] wrote:
I've been reading the Annotated Ada Reference Manual for Ada 95, withc.l.a is unfortunately dead. You should try to post rather here:
the corrigendum (ISO/IEC 8652:1995(E) with COR.1:2000). In 8.2(11.a) it
states:
https://forum.ada-lang.io/
As for your question I don't quite understand the problem. Nothing can
depend on the body, except separate bodies of.
P.S. I too wonder the language of RM, specifically its conflation of stated goals with syntactic means, rather than plainly saying: "we want this, informally, therefore this, formally."
Note also that Ada 2022 RM made things far worse. Ada 95 RM is a
shining beacon of clarity in comparison.
"Dmitry A. Kazakov" <[email protected]> writes:
On 2026-09-29 21:02, [email protected] wrote:
I've been reading the Annotated Ada Reference Manual for Ada 95, withc.l.a is unfortunately dead. You should try to post rather here:
the corrigendum (ISO/IEC 8652:1995(E) with COR.1:2000). In 8.2(11.a) it
states:
https://forum.ada-lang.io/
So long as we are communicating on it, it is live enough for my
purposes. But thanks for the link, I'll consider cross-posting there
also.
(tl;dr: semantic dependence is only required in order for a compilation
unit to be included by the immediate scope of a library_item, not the immediate scope of any declarations contained within it. Long version follows.)
Right, I understand this to be the intent. The problem is twofold:
1. I haven't been able to find anywhere in the standard that actually
spells out formally, in normative text, that this is the case, and by
what mechanism.
For example:
package P is
pragma Elaborate_Body;
end P;
package body P is
X : Integer := 1;
end P;
package P.C is
private
X2 : Integer := X; -- (1)
end P.C;
The RM is clear that the declaration of P.C occurs immediately within
the declarative region of the declaration of P, and that the declaration
of P.X occurs immediately within the declarative region of the
declaration of P
Note also that Ada 2022 RM made things far worse. Ada 95 RM is a
shining beacon of clarity in comparison.
Then it's a good thing I'm starting with Ada 95. One step at a time,
someday I shall attain the heights of mind-reading necessary to
understand the Ada 2022 RM.
Paganini.BOFH.team does not have this thread's original post (from
Eternal September).
For example:
package P is
pragma Elaborate_Body;
end P;
package body P is
X : Integer := 1;
end P;
package P.C is
private
X2 : Integer := X; -- (1)
end P.C;
All of this is made super-explicit in 7.2(1) but a language lawyer
enjoys delving into details :)
[email protected] writes:
For example:
package P is
pragma Elaborate_Body;
end P;
package body P is
X : Integer := 1;
end P;
Reading 8.1(7), the declarative region of X includes only "the text of
the construct". No additional text is included because none of
8.1(8..11) apply.
Per 8.1(13), the declaration of X occurs "immediately within" the declarative_part of the body of P (see 7.2(2)).
The scope of the declaration of X starts immediately after the "1;" and extends to the end of the immediately enclosing declarative region, per 8.2(2).
Neither 8.2(3) nor 8.2(4) apply because X is not a library unit and X
is not declared in the private part of a library unit.
Therefore, X
is visible only in the body of P, which is the immedtately enclosing declarative region.
package P.C is
private
X2 : Integer := X; -- (1)
end P.C;
The declaration of P.C occurs within the scope of the *declaration* of
P (its "declarative region", not in that of the *body* of P, per
8.1(16).
Eternal September). || | |Probably was filtered out because of PGP signature." | |---------------------------------------------------------------------|
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,145 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 293:04:51 |
| Calls: | 14,726 |
| Calls today: | 2 |
| Files: | 186,500 |
| D/L today: |
2,319 files (659M bytes) |
| Messages: | 2,555,791 |
| Posted today: | 4 |