CVS difference for ais/ai-00262.txt

Differences between 1.12 and version 1.13
Log of other versions for file ais/ai-00262.txt

--- ais/ai-00262.txt	2002/06/14 23:48:56	1.12
+++ ais/ai-00262.txt	2002/07/23 01:05:24	1.13
@@ -1,6 +1,8 @@
-!standard 10.01.02 (04)                               02-05-10  AI95-00262/04
+!standard 10.01.02 (04)                              02-07-11  AI95-00262/05
 !standard 10.01.02 (08)
 !class amendment 01-02-15
+!status Amendment 200Y 02-07-11
+!status ARG Approved 8-0-0  02-06-23
 !status work item 02-05-23
 !status ARG Approved 7-0-0  02-02-11
 !status work item 01-02-15
@@ -11,8 +13,9 @@
 
 !summary
 
-The context clause "private with" makes a unit available only in the private
-part of a package.
+The context clause "private with" allows withing of private units in visible
+unit specifications, and does not make unit available in the visible part of
+a package.
 
 !problem
 
@@ -67,15 +70,14 @@
 
 Add after 10.1.2(8):
 
-A name denoting a declaration mentioned only in a with_clause which
-includes the reserved word private shall appear only in a context_clause,
-body, private part of a package or generic package, or private descendant of
-the unit on which the with_clause appears. Such a name shall not appear in
-a use_clause in a context_clause.
+A name denoting a library item that is visible only due to being mentioned in
+with_clauses that include the reserved word private shall appear only within
+    * a private part,
+    * a body,
+    * a private descendant of the unit on which one of these with_clauses
+      appear, or
+    * a pragma within a context clause.
 
-A with_clause which includes the reserved word private shall appear only
-in the context_clause of a package_declaration or generic_package_declaration.
-
 !discussion
 
 Private withs do not allow access to the library unit in the visible part of
@@ -121,25 +123,23 @@
 With the legality rule as proposed, the B at (1) is illegal. If the user meant
 A.B, they can still say that.
 
-Private withs are allowed only on (generic) package specifications. This avoids
-confusion as to the meaning of them on bodies and subprogram specifications.
-We could allow them on bodies, but they would have to be equivalent to regular
-withs. For subprograms, they could be defined to not have an effect in the
-subprogram specification (useful on subprogram bodies), but this is of limited
-value.
-
-Ada allows a unit to be withed multiple times in a single context clause.
-In order to handle this, we have proposed that the legality rule is written
-so that if a unit is withed by both a regular with and a private with, the
-legality rule does not apply. Alternatively, we could have made such a
-combination illegal. But that doesn't seem worthwhile, and it adds an
-additional new check.
+Private withs are allow on all compilation units. They are essentially
+equivalent to a regular with on bodies. We considered making them illegal
+on units other than (generic) package specifications, but that adds a rule
+with little benefit to users.
+
+Ada allows a unit to be withed multiple times in a single context clause. In
+order to handle this, the legality rule is written so that if a unit is withed
+by both a regular with and a private with, the legality rule does not apply.
+Alternatively, we could have made such a combination illegal. But that doesn't
+seem worthwhile, and it adds an additional new check.
 
 The legality rule prohibits private withed units from being used in use_clauses
 in context_clauses. Allowing this would substantially complicate the legality
 rule for the use of such items, without much benefit. The user can always put
 the use clause in the private part. Private withed units are allowed in
-context clause pragmas such as Elaborate.
+context clause pragmas such as Elaborate, since elaboration issues matter just
+as much in the private part as in the rest of a package.
 
 !example
 
@@ -194,9 +194,9 @@
 !corrigendum 10.1.2(04)
 
 @drepl
-@xindent<with_clause ::= @b<with> @i<library_>unit_name {, @i<library_>unit_name}>
+@xindent<@fa<with_clause ::= @b<with> @i<library_>unit_name {, @i<library_>unit_name}>>
 @dby
-@xindent<with_clause ::= [@b<private>] @b<with> @i<library_>unit_name {, @i<library_>unit_name}>
+@xindent<@fa<with_clause ::= [@b<private>] @b<with> @i<library_>unit_name {, @i<library_>unit_name}>>
 
 !corrigendum 10.1.2(08)
 
@@ -212,17 +212,16 @@
 @xbullet<the body or subunit of a (public or private) descendant of that
 library unit; or>
 @xbullet<the declaration of a public descendant of that library unit, and
-the @fa<with_clause> shall include the reserved keyword @b<private>.>
+the @fa<with_clause> shall include the keyword @b<private>.>
 
-A @fa<name> denoting a declaration mentioned only in a @fa<with_clause> which
-includes the reserved keyword @b<private> shall appear only in a
-@fa<context_clause>, @fa<body>, private part of a package or generic package,
-or private descendant of the unit on which the @fa<with_clause> appears. Such a
-@fa<name> shall not appear in a @fa<use_clause> in a @fa<context_clause>.
-
-A @fa<with_clause> which includes the reserved keyword @b<private> shall appear
-only in the @fa<context_clause> of a @fa<package_declaration> or
-@fa<generic_package_declaration>.
+A @fa<name> denoting a library item that is visible only due to being
+mentioned in @fa<with_clause>s that include the keyword @b<private>
+shall appear only within
+@xbullet<a private part,>
+@xbullet<a body,>
+@xbullet<a private descendant of the unit on which one of these
+@fa<with_clause>s appear, or>
+@xbullet<a pragma within a context clause.>
 
 !ACATS test
 

Questions? Ask the ACAA Technical Agent