To: J3 J3/15-162 Subject: Clarify relationship of coarrays and intrinsic assignment From: Van Snyder Reference: 15-007r1, 16-161 Date: 2015 June 06 1. Introduction =============== The requirements and prohibitions governing intrinsic assignment, and the relationships of polymorphism, allocatability, array shape, deferred length parameters, coarrays, and coindexed objects therein, are divided into two places, are contradictory, are confusing, and some are poorly written. Items (1) and (8) in the list in 7.2.1.2p1 do not exclude coindexed objects, which appears to allow them, but then coindexed objects are excluded in those contexts by 7.2.1.2p2. Item (8) requires "corresponding type parameter" to be deferred, but the "corresponding type parameter" is a parameter of , not . Clearly, the type parameter of is the one that should be required to be deferred. Reading the introductory sentence of 7.2.1.2p2 and the third item, one has the nonsense phrase "... the variable each deferred length type parameter...." The third item of 7.2.1.2p2 applies to character variables because, unlike item (8) in the list in 7.2.1.2p1, it is not limited to derived-type variables, but this is contradicted by 7.2.1.3p10. Should this be the subject of an interp? 2. Edits ======== [157:10 7.2.1.2p1] After "intrinsic assignment statement," insert "if is a coarray or coindexed object, o the variable shall not be polymorphic, o the variable and expr shall be conformable, and o if the variable is of derived type each length type parameter of the variable shall have the same value as the corresponding type parameter of . {The third item introduces a slightly different requirement from the third item in 7.2.1.2p2 in 15-007r1: The requirement does not apply to a deferred length parameter of a character variable. This is the subject of the interp in 16-161.} Otherwise o the variable and expr shall be conformable unless the variable is an allocatable array that has the same rank as expr, and o if the variable is of derived type each length type parameter of the variable shall have the same value as the corresponding type parameter of unless the variable is allocatable and the type parameter of is deferred. Further," [157:11 7.2.1.2p1(1)] Delete "and not a coarray". [157:13-14 7.2.1.2p1(3), 157:22-24 7.2.1.2p1(8)] Delete list items (3) and (8), which are handled by the "Otherwise" paragraph introduced above. [157:19 7.2.1.2p1(6)] Insert "and" after the final comma. [157:21 7.2.1.2p1(7)] Replace ", and" with a full stop. [157:25 7.2.1.2p2] After "the variable" append "shall not have an allocatable ultimate component." [158:1-3 7.2.1.2p2] Delete the list. 3. Alternative Edits ==================== [157:8+ 7.2.1.2] Insert constraints: "C714a (R732) If is a coarray or coindexed object, it shall not be polymorphic. "C714b (R732) If is polymorphic it shall be allocatable. "C714c (R732) If is an array then shall be an array of the same rank as . "C714d (R732) If is of type character and of ISO 10646, ASCII, or default character kind, shall be of ISO 10646, ASCII, or default character kind. Otherwise if is of type character shall have the same kind type parameter value as . "C714e (R732) If is of derived type each kind type parameter of shall have the same value as the corresponding kind type parameter of . "C714f (R732) If is polymorphic it shall be type compatible with ; otherwise the declared types of and shall conform as specified in table 7.8. " {Should the conversion of requirements in 7.2.1.2p1-2 to constraints be mentioned in the introduction?} [157:10 7.2.1.2p1] After "intrinsic assignment statement," insert "if is a coarray or coindexed object, o the variable and expr shall be conformable, and o if the variable is of derived type each length type parameter of the variable shall have the same value as the corresponding type parameter of . {The third item introduces a slightly different requirement from the third item in 7.2.1.2p2 in 15-007r1: The requirement does not apply to a deferred length parameter of a character variable. This is the subject of the interp in 16-161.} Otherwise o the variable and expr shall be conformable unless the variable is an allocatable array that has the same rank as expr, and o if the variable is of derived type each length type parameter of the variable shall have the same value as the corresponding type parameter of unless the variable is allocatable and the type parameter of is deferred. " [157:11-24 7.2.1.2p1(1-8)] Delete the list. [157:25 7.2.1.2p2] After "the variable" append "shall not have an allocatable ultimate component." [158:1-3 7.2.1.2p2] Delete the list. 4. If there is no interp about coindexed character assignment ============================================================= [xviii Introduction] Under "Data usage and computation" insert "Intrinsic assignment to coindexed character variables with deferred length different from that of the expression is now permitted."