CVS difference for ais/ai-50217.txt
--- ais/ai-50217.txt 2005/06/16 23:47:53 1.21
+++ ais/ai-50217.txt 2005/08/04 00:54:14 1.22
@@ -1,4 +1,4 @@
-!standard 10.01.01 (12) 05-06-07 AI95-00217-06/14
+!standard 10.01.01 (12) 05-06-20 AI95-00217-06/15
!standard 10.01.01 (15)
!standard 10.01.01 (26)
!standard 10.01.02 (04)
@@ -6,6 +6,7 @@
!standard 10.01.02 (08)
!standard 10.01.04 (03)
!standard 10.01.04 (06)
+!standard 10.01.06 (02)
!standard 10.02 (06)
!standard 3.10.01 (10)
!standard 4.01 (09)
@@ -153,9 +154,11 @@
*private*.
[There is no syntax for declaring limited views of packages, because they are
-always implicit.] The implicit declaration of a limited view of a package is
-_not_ the declaration of a library unit (the library package_declaration is);
-nonetheless, it is a library_item.
+always implicit.] The implicit declaration of a limited view of a library
+package is _not_ the declaration of a library unit (the library
+package_declaration is); nonetheless, it is a library_item. The implicit
+declaration of the limited view of a library package forms an (implicit)
+compilation unit whose context_clause is empty.
A library package_declaration is the completion of the declaration of its
limited view.
@@ -186,29 +189,35 @@
Replace 10.1.2(6) by:
-A library_item is *named* in a with_clause if it is denoted by a
-library_unit_name in the with_clause. A library_item is *mentioned* in a
-with_clause if it is named in the with_clause or if it is denoted by a
-prefix in the with_clause.
+A library_item (and the corresponding library unit) is *named* in a with_clause
+if it is denoted by a library_unit_name in the with_clause. A library_item (and
+the corresponding library unit) is *mentioned* in a with_clause if it is named
+in the with_clause or if it is denoted by a prefix in the with_clause.
Add after 10.1.2(8):
-A library_item mentioned in a limited_with_clause shall be a
-package_declaration[, not a subprogram_declaration, generic_declaration,
-generic_instantiation, or package_renaming_declaration].
+Redundant[A library_item mentioned in a limited_with_clause shall be
+the implicit declaration of the limited view of a library package,
+not the declaration of a subprogram, generic unit, generic instance,
+or a renaming.]
+AARM Proof: This is redundant because only such implicit declarations
+are visible in a limited_with_clause. See 10.1.6.
+
A limited_with_clause shall not appear on a library_unit_body or subunit.
-A limited_with_clause which names a library_item shall not appear:
+A limited_with_clause that names a library package shall not appear:
-o in the context_clause for the named library_item; or
+o in the context_clause for the explicit declaration of the
+ named library package;
o in the same context_clause as, or within the scope of, a
- nonlimited_with_clause which mentions the same library_item; or
+ nonlimited_with_clause that mentions the same library package; or
-o in the same context_clause as, or within the scope of, a use_clause which
- names an entity declared within the declarative region of the library_item.
+o in the same context_clause as, or within the scope of, a use_clause that
+ names an entity declared within the declarative region of the library
+ package.
AARM Note: We have to explicitly disallow
limited with P;
@@ -223,11 +232,6 @@
way such a dependence can be broken.
End AARM Note.
-Change 10.1.2(9):
-
-"...Thus, within a compilation unit that mentions {a view other than a
-limited view of} its declaration, ..."
-
Add after 10.1.4(3):
The mechanisms for adding a unit mentioned in a limited_with_clause to an
@@ -240,10 +244,23 @@
be mentioned in a limited_with_clause or it can be inserted} [inserting it]
into the environment.
+Change 10.1.6(2):
+
+Within the parent_unit_name at the beginning of a{n explicit} library_item, and
+within a {nonlimited_}with_clause, the only declarations that are visible are
+those that are {explicit} library_items of the environment, and the only
+declarations that are directly visible are those that are {explicit} root
+library_items of the environment. {Within a limited_with_clause, the only
+declarations that are visible are those that are the implicit declaration of
+the limited view of a library package of the environment, and the only
+declarations that are directly visible are those that are the implicit
+declaration of the limited view of a root library package.}
+
Add after 10.2(6):
-o If the limited view of a unit is needed, then so is the full view of the
- unit.
+o If the (implicit) declaration of the limited view of a library
+ package is needed, then so is the explicit declaration of the
+ library package.
!discussion
@@ -648,9 +665,11 @@
@b<private>.
There is no syntax for declaring limited views of packages, because they are
-always implicit. The implicit declaration of a limited view of a package is
-not the declaration of a library unit (the library package_declaration is);
-nonetheless, it is a @fa<library_item>.
+always implicit. The implicit declaration of a limited view of a library
+package is not the declaration of a library unit (the library
+@fa<package_declaration> is); nonetheless, it is a @fa<library_item>.
+The implicit declaration of the limited view of a library package forms
+an (implicit) compilation unit whose @fa<context_clause> is empty.
A library @fa<package_declaration> is the completion of the declaration of
its limited view.
@@ -720,8 +739,10 @@
A @fa<library_item> is @i<mentioned> in a @fa<with_clause> if it is denoted by
a @i<library_unit_>@fa<name> or a @fa<prefix> in the @fa<with_clause>.
@dby
-A @fa<library_item> is @i<named> in a @fa<with_clause> if it is denoted by a
-@i<library_unit_>@fa<name> in the @fa<with_clause>. A @fa<library_item> is
+A @fa<library_item> (and the corresponding library unit)
+is @i<named> in a @fa<with_clause> if it is denoted by a
+@i<library_unit_>@fa<name> in the @fa<with_clause>. A @fa<library_item>
+(and the corresponding library unit) is
@i<mentioned> in a @fa<with_clause> if it is named in the
@fa<with_clause> or if it is denoted by a @fa<prefix> in the @fa<with_clause>.
@@ -733,51 +754,26 @@
the declaration of a private descendant of that library unit or the body
or a subunit of a (public or private) descendant of that library unit.
@dinss
-A @fa<library_item> mentioned in a @fa<limited_with_clause> shall be a
-@fa<package_declaration>, not a @fa<subprogram_declaration>,
-@fa<generic_declaration>, @fa<generic_instantiation>, or
-@fa<package_renaming_declaration>.
+A @fa<library_item> mentioned in a @fa<limited_with_clause> shall be
+the implicit declaration of the limited view of a library package,
+not the declaration of a subprogram, generic unit, generic instance,
+or a renaming.
A @fa<limited_with_clause> shall not appear on a @fa<library_unit_body> or
@fa<subunit>.
-A @fa<limited_with_clause> which names a @fa<library_item> shall not appear:
+A @fa<limited_with_clause> that names a library package shall not appear:
-@xbullet<in the @fa<context_clause> for the named @fa<library_item>; or>
+@xbullet<in the @fa<context_clause> for the
+explicit declaration of the named library package;>
@xbullet<in the same @fa<context_clause> as, or within the scope of, a
-@fa<nonlimited_with_clause> which mentions the same @fa<library_item>; or>
+@fa<nonlimited_with_clause> that mentions the same library package; or>
@xbullet<in the same @fa<context_clause> as, or within the scope of, a
-@fa<use_clause> which names an entity declared within the declarative region of
-the @fa<library_item>.>
-
-!corrigendum 10.1.2(8)
+@fa<use_clause> that names an entity declared within the declarative region of
+the library package.>
-@drepl
-@xindent<@s9<3 A @fa<library_item> mentioned in a @fa<with_clause> of a
-compilation unit is visible within the compilation unit and hence acts just
-like an ordinary declaration.
-Thus, within a compilation unit that mentions its declaration, the name of a
-library package can be given in @fa<use_clause>s and can be used to
-form expanded names, a library subprogram can be called,
-and instances of a generic library unit can be declared.
-If a child of a parent generic package is mentioned in a @fa<with_clause>,
-then the corresponding declaration nested within each visible instance
-is visible within the compilation unit.>>
-@dby
-@xindent<@s9<3 A @fa<library_item> mentioned in a @fa<with_clause> of a
-compilation unit is visible within the compilation unit and hence acts just
-like an ordinary declaration. Thus, within a compilation unit that mentions a
-view other than a limited view of its declaration, the name of a
-library package can be given in @fa<use_clause>s and can be used to
-form expanded names, a library subprogram can be called,
-and instances of a generic library unit can be declared.
-If a child of a parent generic package is mentioned in a @fa<with_clause>,
-then the corresponding declaration nested within each visible instance
-is visible within the compilation unit.>>
-
-
!corrigendum 10.1.4(3)
@drepl
@@ -799,6 +795,31 @@
be mentioned in a @fa<limited_with_clause> or it can be inserted
into the environment.
+!corrigendum 10.1.6(2)
+!comment This also includes the AI-312 change.
+
+@drepl
+Within the @fa<parent_unit_name> at the beginning of a
+@fa<library_item>, and within a @fa<with_clause>, the only declarations that
+are visible are those that are @fa<library_item>s of the environment, and the
+only declarations that are directly visible are those that are root
+@fa<library_item>s of the environment. Notwithstanding the
+rules of 4.1.3, an expanded name in a @fa<with_clause> may consist of a
+@fa<prefix> that denotes a generic package and a @fa<selector_name> that
+denotes a child of that generic package. [(The child is necessarily a generic
+unit; see 10.1.1.)]
+@dby
+Within the @fa<parent_unit_name> at the beginning of an explicit
+@fa<library_item>, and within a @fa<nonlimited_with_clause>, the only
+declarations that are visible are those that are explicit
+@fa<library_item>s of the environment, and the only declarations that are
+directly visible are those that are explicit root @fa<library_item>s of
+the environment. Within a @fa<limited_with_clause>, the only declarations
+that are visible are those that are the implicit declaration of the
+limited view of a library package of the environment, and the only
+declarations that are directly visible are those that are the
+implicit declaration of the limited view of a root library package.
+
!corrigendum 10.2(6)
@drepl
@@ -807,8 +828,9 @@
@dby
@xbullet<If a compilation unit with stubs is needed, then so are any
corresponding subunits;>
-@xbullet<If the limited view of a unit is needed, then the full view of the
-unit is needed.>
+@xbullet<If the (implicit) declaration of the limited view of a library
+package is needed, then so is the explicit declaration of the
+library package.>
!appendix
@@ -3953,7 +3975,7 @@
-----------------
Thoughts on the implementation of "limited with" in AdaMagic
- $Revision: 1.21 $ $Date: 2005/06/16 23:47:53 $
+ $Revision: 1.22 $ $Date: 2005/08/04 00:54:14 $
The "limited with" clause makes a "limited view"
of a package visible in the compilation unit
@@ -5762,7 +5784,7 @@
-----------------
Thoughts on the implementation of "limited with" in AdaMagic
- $Revision: 1.21 $ $Date: 2005/06/16 23:47:53 $
+ $Revision: 1.22 $ $Date: 2005/08/04 00:54:14 $
The "limited with" clause makes a "limited view"
of a package visible in the compilation unit
Questions? Ask the ACAA Technical Agent