09-178 To: J3 From: Van Snyder Subject: Constraintify intrinsic assignment, or at least clean it a bit Date: 2009 April 01 References: 09-007r1 1. Discussion Eight of the ten requirements in the list in 7.2.1.2 [155:8ff] could be constraints. I would prefer that processors be required to diagnose these failures than that they be allowed to require me to track them down with a debugger. 2. Edits w.r.t. 09-007. Subclause numbers in curly brackets indicate that the previous word should be linked in the PDF to that subclause. Words or phrases in curly brackets are links in the existing text that ought to be preserved. [155:5+ 7.2.1.1 C713+]-------------------------------------------------- Editor: Insert new syntax rules and constraints: " R732a <> R732b <> C713a (R732b) If is {polymorphic} it shall be {allocatable}. C713b (R732b) If is a {coindexed object} it shall not be of a type that has an {allocatable} {ultimate component}. C713c (R732b) If is an array, shall be an array. C713d (R732b) If is an {allocatable} {coarray} or {coindexed object} it shall not be {polymorphic}. C713e (R732b) If is of type character and of {ISO 10646}, {ASCII}, or default character kind, shall be of {ISO 10646}, {ASCII}, of default character kind; otherwise if is of type character, shall have the same {kind type parameter} value as . C713f (R732b) If is of derived type each {kind type parameter} of shall have the same value as the corresponding {kind type parameter} of . C713g (R732b) If is {polymorphic} it shall be {type compatible} with and have the same {rank}; otherwise the declared types of and shall conform as specified in Table {7.10} " Move Table 7.10 to here and replace "the variable" in the heading by "". It would be nice if we could get Table 7.10 into Annex D. Preserve the hypertext links from the list in 7.2.1.2 in the corresponding constraint. ! The proposed syntax rule R732a isn't used ! anywhere. It is proposed for completeness. The proposed syntax rule ! R732b isn't referenced in another syntax ! rule. It is proposed as a place to attach constraints. R732b and its ! constraints could equally well be put into 7.2.1.2, in which case ! R732a should be put into 7.2.1.4, or not included because its absence ! wouldn't be so conspicuous if it would otherwise be expected in ! 7.2.1.4. [155:10-26 7.2.1.2p1]--------------------------------------------------- Editor: Delete "In an intrinsic assignment," (because the subclause heading is "Intrinsic assignment statement", 7.2.1.1p1 requires intrinsic assignment statements to meet the requirements for intrinsic assignment statements, and after the following edits we won't need it to introduce a list) and replace the list in 7.2.1.2 by the following: "If is a {coarray} or a {coindexed object}, is not {allocatable}, or does not have the same {rank} as , the shapes of and shall conform {1.3.31} (1.3.31). "If is of derived type and if it is a {coarray}, a {coindexed object}, or is not {allocatable}, each non{deferred} {length type parameter} of shall have the same value as the corresponding type parameter of ." {In the list, these were "(4) The shapes of the variable and shall conform unless the variable is an allocatable array that has the same rank as and is neither a coarray nor a coindexed object," and "(10) 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, is not a coarray or coindexed object, and its corresponding type parameter is deferred," which I found confusing because of the double negatives.} [155:28 7.2.1.2p3]------------------------------------------------------ Editor: Replace "the variable" by "". 3. Alternative edits [155:11-28 7.2.1.2p1-3]------------------------------------------------- Editor: Either replace all occurrences of "the variable" by "", or replace all occurrences of "" by "the variable". [155:14-15 7.2.1.2p1(4)]------------------------------------------------ Editor: Replace list item (4) by "(4) if is a {coarray} or a {coindexed object}, is not {allocatable}, or does not have the same {rank} as , the shapes of and shall conform {1.3.31} (1.3.31)," and move it after list item (9) [155:23 7.2.1.2p1(9)]--------------------------------------------------- Editor: Insert "type parameter" after "kind". Delete "and" at the end of list item (9). [155:24-26 7.2.1.2p1(10)]----------------------------------------------- Editor: Replace list item (10) by "(10) if is of derived type and if it is a {coarray}, a {coindexed object}, or is not {allocatable}, each non{deferred} {length type parameter} of shall have the same value as the corresponding type parameter of , and" and move item (6) to the end of the list, terminating it with a full stop instead of a comma.