CVS difference for ais/ai-00366.txt

Differences between 1.8 and version 1.9
Log of other versions for file ais/ai-00366.txt

--- ais/ai-00366.txt	2004/09/04 01:13:46	1.8
+++ ais/ai-00366.txt	2004/09/21 03:29:00	1.9
@@ -1,4 +1,12 @@
-!standard 10.2.1                                     04-05-26  AI95-00366/03
+!standard 10.2.1(16)                                  04-09-20  AI95-00366/04
+!standard 3.2(6)
+!standard 10.2.1(17)
+!standard 10.2.1(18)
+!standard 13.13.2(1)
+!standard E.2.2(8)
+!standard E.2.2(14)
+!standard E.2.2(17)
+!standard E.2.3(14.1)
 !class amendment 03-12-14
 !status work item 03-12-14
 !status received 03-12-14
@@ -12,6 +20,13 @@
 for which no storage pool is created. Furthermore, declarations in generic
 formal parts do not affect the purity of units.
 
+Various places in the RM, notably the semantics of remote types and remote call
+interfaces in E.2.2 and E.2.3, are fixed to preserve their intended semantics,
+given the above change. For this purpose, we introduce the concept of types
+supporting external streaming in 13.13.2.
+
+A missing definition of the term "part of a type" is added in 3.2.
+
 !problem
 
 In pure units access-to-subprogram types and access-to-object types,
@@ -22,52 +37,200 @@
 Furthermore, there is no technical reason for including declarations
 in generic formal parts for assessing whether a unit is pure.
 
+Independently, a definition for the term "part of a type" is missing
+in the RM.
+
 !proposal
+
+(For details, see wording.)
 
-(see wording)
+Allowing access types in pure packages requires changes in the description of
+the remote type and remote interface semantics of the language to preserve the
+prohibition of a semantic dependence on access types that do not support
+external streaming.
 
 !wording
 
+<<< for the purpose of discussing the AI, relevant paragraphs that I believe
+    need no change are included here. E.2.3(11) requires some scrutiny.
+    The final version of the AI should delete them. >>>
+
+Replace 3.2(6):
+
+    {subcomponent} The term subcomponent is used in this International
+    Standard in place of the term component to indicate either a component,
+    or a component of another subcomponent. Where other subcomponents are
+    excluded, the term component is used instead. {part (of an object or value)}
+    Similarly, a part of an object or value is used to mean the whole object or
+    value, or any set of its subcomponents.
+
+by:
+
+    {subcomponent} The term subcomponent is used in this International
+    Standard in place of the term component to indicate either a component,
+    or a component of another subcomponent. Where other subcomponents are
+    excluded, the term component is used instead. {part (of an object or value)}
+    Similarly, a part of an object or value is used to mean the whole object or
+    value, or any set of its subcomponents. The terms component, subcomponent and
+    part are also applied to types meaning the component, subcomponent or part
+    of objects and values of the type.
+
+Note for Corrigendum: "component" is incorrectly italicised.
+
 Replace 10.2.1(16)
-A pure library_item is a preelaborable library_item that does not
-contain the declaration of any variable or named access type, except
-within a subprogram, generic subprogram, task unit, or protected unit.
+    A pure library_item is a preelaborable library_item that does not
+    contain the declaration of any variable or named access type, except
+    within a subprogram, generic subprogram, task unit, or protected unit.
 
 by:
 
-A pure library_item is a preelaborable library_item that does not
-contain the declaration of any variable, or named access-to-object
-type for which the Storage_Size has not been specified by a static
-expression with value 0, excepting declarations of imported variables
-and declarations within a subprogram, generic subprogram, generic
-formal part, task unit, or protected unit.
+    A pure library_item is a preelaborable library_item that does not
+    contain the declaration of any variable, or named access-to-object
+    type for which the Storage_Size has not been specified by a static
+    expression with value 0 and is not immutably defined to be 0,
+    excepting declarations of imported variables and declarations within a
+    subprogram, generic subprogram, generic formal part, task unit, or
+    protected unit.
+
+
+Replace 10.2.1(17)
+    A pragma Pure is used to declare that a library unit is pure. If a
+    pragma Pure applies to a library unit, then its compilation units
+    shall be pure, and they shall depend semantically only on compilation
+    units of other library units that are declared pure.
+
+by:
+    A pragma Pure is used to declare that a library unit is pure. If a
+    pragma Pure applies to a library unit, then its compilation units
+    shall be pure, and they shall depend semantically only on compilation
+    units of other library units that are declared pure.
+    Furthermore, the full view of any private type declared in the visible
+    part of the library unit shall support external streaming (see 13.13.2).
+
 
 Replace 10.2.1(18)
-If a library unit is declared pure, then the implementation is
-permitted to omit a call on a library-level subprogram of the library
-unit if the results are not needed after the call. Similarly, it may
-omit such a call and simply reuse the results produced by an earlier
-call on the same subprogram, provided that none of the parameters are
-of a limited type, and the addresses and values of all by-reference
-actual parameters, and the values of all by-copy-in actual parameters,
-are the same as they were at the earlier call. This permission applies
-even if the subprogram produces other side effects when called.
 
+    If a library unit is declared pure, then the implementation is
+    permitted to omit a call on a library-level subprogram of the library
+    unit if the results are not needed after the call. Similarly, it may
+    omit such a call and simply reuse the results produced by an earlier
+    call on the same subprogram, provided that none of the parameters are
+    of a limited type, and the addresses and values of all by-reference
+    actual parameters, and the values of all by-copy-in actual parameters,
+    are the same as they were at the earlier call. This permission applies
+    even if the subprogram produces other side effects when called.
+
 by:
+
+    If a library unit is declared pure, then the implementation is
+    permitted to omit a call on a library-level subprogram of the library
+    unit if the results are not needed after the call. In addition, the
+    implementation may omit a call on such a subprogram and simply reuse the
+    results produced by an earlier call on the same subprogram, provided
+    that none of the parameters nor any object accessible via access
+    values from the parameters are of a limited type, and the addresses
+    and values of all by-reference actual parameters, the values of all
+    by-copy-in actual parameters, and the values of all objects accessible
+    via access values from the parameters, are the same as they were at
+    the earlier call. This permission applies even if the subprogram
+    produces other side effects when called.
+
+Add after 13.13.2(1/1):
+
+    A type is said to support external streaming if Read and Write attributes
+    are available that provide for sending values of such a type between active
+    partitions, with Write marshalling the representation, and Read
+    unmarshalling the representation.
+
+    A type with a part that is of an access type supports external streaming
+    only if that access type or the type of some part that includes the access
+    type  component, has user-defined Read and Write attributes. [An anonymous
+    access type does not support external streaming.] A limited type supports
+    external streaming only if it has user-defined Read and Write attributes.
+    All other types support external streaming.
+
+Replace E.2.2(8):
+    if the full view of a type declared in the visible part of the library
+    unit has a part that is of a non-remote access type, then that access type,
+    or the type of some part that includes the access type subcomponent, shall
+    have user-specified Read and Write attributes.
+
+by
+    the full view of each type declared in the visible part of the library
+    unit shall support external streaming.
+
+
+Replace E.2.2(14/1):
+
+    The primitive subprograms of the corresponding specific
+    limited private type shall only have access parameters if they are
+    controlling formal parameters; each non-controlling formal parameter
+    shall have either a nonlimited type or a type with Read and Write
+    attributes specified via an attribute_definition_clause;
+
+by
+
+    The primitive subprograms of the corresponding specific
+    limited private type shall only have access parameters if they are
+    controlling formal parameters; each non-controlling formal parameter
+    shall support external streaming;
+
+
+Replace E.2.2(17/1)
+
+    The Storage_Pool and Storage_Size attributes are not defined for
+    remote access-to-class-wide types; the expected type for an allocator
+    shall not be a remote access-to-class-wide type; a remote
+    access-to-class-wide type shall not be an actual parameter for a
+    generic formal access type.
+
+by
+
+    The Storage_Pool attribute is not defined for a
+    remote access-to-class-wide type; the expected type for an allocator
+    shall not be a remote access-to-class-wide type; a remote
+    access-to-class-wide type shall not be an actual parameter for a
+    generic formal access type. The Storage_Size attribute of a remote
+    access-to-class-wide type yields 0; it is not allowed in an
+    attribute_definition_clause.
+
+
+Leave unchanged the Note E.2.2(18):
+    5  A remote types library unit need not be pure, and the types it defines
+       may include levels of indirection implemented by using access types.
+       User-specified Read and Write attributes (see 13.13.2) provide for
+       sending values of such a type between active partitions, with
+       Write marshalling the representation, and Read unmarshalling any levels
+       of indirection.
+
+
+Change E.2.3(14.1) from
+
+    * it shall not be, nor shall its visible part contain, a subprogram
+      (or access-to-subprogram) declaration whose profile has an access
+      parameter, or a formal parameter of a limited type unless that
+      limited type has user-specified Read and Write attributes;
+
+to
 
-If a library unit is declared pure, then the implementation is
-permitted to omit a call on a library-level subprogram of the library
-unit if the results are not needed after the call. In addition, the
-implementation may omit a call on such a subprogram and simply reuse the
-results produced by an earlier call on the same subprogram, provided
-that none of the parameters nor any object accessible via access
-values from the parameters are of a limited type, and the addresses
-and values of all by-reference actual parameters, the values of all
-by-copy-in actual parameters, and the values of all objects accessible
-via access values from the parameters, are the same as they were at
-the earlier call. This permission applies even if the subprogram
-produces other side effects when called.
+    * it shall not be, nor shall its visible part contain, a subprogram (or
+      access-to-subprogram) declaration whose profile has [an access parameter]
+      or a parameter of a type that does not support external streaming;
+
+
+Leave E.2.3(11/1+11.a) unchanged:
+    its visible part shall not contain the declaration of a
+    limited type;
+
+    Reason: We disallow the declaration of task and protected types, since
+    calling an entry or a protected subprogram implicitly passes an object of a
+    limited type (the target task or protected object). We disallow other
+    limited types since we require that such types have user-defined Read
+    and Write attributes, but we certainly don't want the Read and Write
+    attributes themselves to involve remote calls (thereby defeating their
+    purpose of marshalling the value for remote calls).
 
+
 !discussion
 
 Pure implies that a unit has no state. Access-to-object types are
@@ -103,6 +266,14 @@
 changed and the call still omitted. For instance, we do not want to allow the
 omission of calls on a Pure random number generator!
 
+Furthermore, the semantics of Remote Types and Remote Call Invocation library
+units (E.2.2 and E.2.3) need to be adjusted to disallow dependence on an
+access type in a pure unit, for which user-defined Read and Write attributes
+have not been specified. To simplify wording, we introduce the concept of
+types supporting external streaming in 13.13.2 und use this more intuitive
+term throughout Section E wherever user-defined Read and Write attributes
+are required.
+
 !example
 
 --!corrigendum
@@ -1945,6 +2116,41 @@
 
 I'm not going to claim that this is a lot more understandable, but less
 wording is usually better...
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Monday, September 20, 2004  9:51 PM
+
+The version of AI-366 that Erhard distributed at the meeting includes the
+wording:
+
+    A type is said to support external streaming if Read and Write attributes
+    are available that provide for sending values of such a type between active
+    partitions, with Write marshalling the representation, and Read
+    unmarshalling the representation.
+
+    A type with a part that is of an access type supports external streaming
+    only if that access type or the type of some part that includes the access
+    type  component, has user-defined Read and Write attributes. [An anonymous
+    access type does not support external streaming.] A limited type supports
+    external streaming only if it has user-defined Read and Write attributes.
+    All other types support external streaming.
+
+This isn't quite correct. The corrigendum defines inherited and/or constructed
+attributes in some cases. AI-195 corrects this so that a limited type's
+attributes are "available" in various cases. (In these cases, the stream
+attribute has a defined result.) Clearly, there is no reason to disallow Annex
+E uses whenever there is a stream attribute defined for a type. Thus, the
+wording should use "available".
+
+"A limited type supports external streaming only if it has available Read
+and Write attributes."
+
+The use of "only if" in the above wording is clever, but I think an AARM note
+is required to note that "only if" means that a limited type with an access
+type part must satisify both parts of the rule. It's certainly not obvious on
+casual reading.
 
 ****************************************************************
 

Questions? Ask the ACAA Technical Agent