CVS difference for ais/ai-50217.txt

Differences between 1.14 and version 1.15
Log of other versions for file ais/ai-50217.txt

--- ais/ai-50217.txt	2004/06/25 01:30:52	1.14
+++ ais/ai-50217.txt	2004/09/04 01:13:49	1.15
@@ -1,4 +1,4 @@
-!standard 10.01.01   (12)                           04-05-21  AI95-00217-06/08
+!standard 10.01.01   (12)                           04-08-26  AI95-00217-06/09
 !standard 10.01.01   (26)
 !standard 10.01.02   (04)
 !standard 10.01.02   (06)
@@ -201,9 +201,23 @@
 o  in the scope of a nonlimited_with_clause which mentions the same
    library_item; or
 
+o  in the context_clause for the named library_item; or
+
 o  in the scope of a use_clause which names an entity declared within the
    declarative region of the library_item.
 
+AARM Note: We have to explicitly disallow
+   limited with P;
+   package P is ...
+as we can't depend on the semantic dependence rules to do it for us as with
+regular withs. This says "named" and not "mentioned" in order that
+   limited private with P.Child;
+   package P is ...
+can be used to allow a mutual dependence between the private part of P and
+the private child P.Child, which occurs in interfacing and other problems.
+Since the child always semantically depends on the parent, this is the only
+way such a dependence can be broken.
+End AARM Note.
 
 Add after 10.1.4(3):
 
@@ -705,6 +719,8 @@
 @xbullet<in the scope of a @fa<nonlimited_with_clause> which mentions the same
 @fa<library_item>; or>
 
+@xbullet<in the @fa<context_clause> for the named @fa<library_item>; or>
+
 @xbullet<in the scope of a @fa<use_clause> which names an entity declared
 within the declarative region of the @fa<library_item>.>
 
@@ -3883,7 +3899,7 @@
 -----------------
 Thoughts on the implementation of "limited with" in AdaMagic
 
-          $Revision: 1.14 $ $Date: 2004/06/25 01:30:52 $
+          $Revision: 1.15 $ $Date: 2004/09/04 01:13:49 $
 
 The "limited with" clause makes a "limited view"
 of a package visible in the compilation unit
@@ -5692,7 +5708,7 @@
 -----------------
 Thoughts on the implementation of "limited with" in AdaMagic
 
-          $Revision: 1.14 $ $Date: 2004/06/25 01:30:52 $
+          $Revision: 1.15 $ $Date: 2004/09/04 01:13:49 $
 
 The "limited with" clause makes a "limited view"
 of a package visible in the compilation unit
@@ -9866,5 +9882,73 @@
 
 ***************************************************************
 
+From: Pascal Leroy
+Sent: Wednesday, August 25, 2004  2:55 AM
+
+As far as I can tell, this AI doesn't prevent unit P from having a limited
+with P.  I think we want to disallow this case.
+
+***************************************************************
+
+From: Randy Brukardt
+Sent: Thursday, August 26, 2004  9:49 PM
+
+What does this for regular with clauses? Nothing jumps out at me.
+
+It appears that adding
+
+   o in the context_clause for the named library_item; or
+
+to 10.1.2(8) would do the trick. Right?
+
+***************************************************************
+
+From: Pascal Leroy
+Sent: Friday, August 27, 2004  1:53 AM
+
+In the case of nonlimited withs, the semantic dependences rules catch this
+case.  10.1.1(26) has: "A compilation unit depends semantically upon each
+library_item mentioned in a with_clause of the compilation unit."  And
+10.1.4(5) has: "When a compilation unit is compiled, all compilation units
+upon which it depends semantically shall already exist in the
+environment".
+
+For any sensible definition of "already exist" this means that when you
+try to compile P the compiler checks that P already exists in the
+environment and since it doesn't, it ultimately complains. (My favorite
+compiler considers, for arcane reasons, that P is already in the
+environment when it starts to compile P, so extra checking is required;
+but that's just a screw up, er, an idiosyncrasy.)
+
+In the case of limited withs, there is no semantic dependence (that's the
+point, remember?) so 10.1.4(5) doesn't kick in.
+
+
+Your wording would be fine.  I am still debating whether we want to allow:
+
+	limited with P.Q;
+	package P is ... end;
+
+If we do, then your proposed wording works.  If we don't then it doesn't,
+because P is mentioned, not named, by the limited with clause.
+
+I have a vague recollection that we wanted to allow this case, although I
+am too lazy to dig it up in the minutes...
+
+***************************************************************
+
+From: Randy Brukardt
+Sent: Friday, August 27, 2004  10:33 PM
+
+We definitely want to allow it on bodies; regular withs like that are allowed
+on bodies! (library_items include library_unit_bodies). I don't think it is
+harmful on specs, although weird. But it would make sense if this is a limited
+private with of a private child; then you could be mutually dependent with the
+(hidden) helper package. You certainly can't break the dependence the other way
+(the child always depends on the parent).
+
+I'll add this to AI-217-6, and add it to our list of corrections.
+
+***************************************************************
 
 

Questions? Ask the ACAA Technical Agent