J3/17-123 To: J3 From: Malcolm Cohen Subject: Why are team specifiers always variables? Date: 2017 February 07 1. Introduction --------------- Team specifiers are required to be variables (nearly?) everywhere, even where they are not being modified. This prevents the user from using a function that returns TYPE(TEAM_TYPE) in such places; instead, he needs to assign the value to a temporary variable. This restriction does not appear to be necessary or useful. 2. Discussion ------------- The most obvious places where this would be useful are CHANGE TEAM and SYNC TEAM. In particular, the latter requires the user to write something like tmp = GET_TEAM(PARENT_TEAM) SYNC TEAM ( tmp ) instead of the simpler SYNC TEAM ( GET_TEAM(PARENT_TEAM) ) Requring the user to assign the value of GET_TEAM and any function he writes that returns a TEAM_TYPE value is inconvenient and arguably error-prone. Similarly, for CHANGE TEAM, if the user has a team selection function, he needs to write tmp = select_team(...) CHANGE TEAM ( tmp ) instead of the simpler CHANGE TEAM ( select_team(...) ) Admittedly the use case for this is slightly weaker than SYNC TEAM, and CHANGE TEAM is where the team-variable BNF is defined, making edits to that slightly more complicated. Finally, the edits contain some cosmetic changes because team-variables do not "specify" a team, they "identify" a team, according to paragraph 2 of 16.10.2.32 TEAM_TYPE. 3. Image selectors ------------------ It might be unlikely that anyone will really want to use a function reference in the TEAM= specifier of an image selector, but it would be consistent and easy to change this as well. Supplementary edits to do this are at the end of the paper. 4. Decisions ------------ The basic decision is do we want to change this? (a) for SYNC TEAM (edits in section 5) (b) for SYNC TEAM and CHANGE TEAM (edits in section 6) or (c) no change (some cosmetic edits should still be done). In the case of (a) or (b), there is a secondary question which is whether the TEAM= specifier should also be changed. The edits to do that are in section 7. 5. Edits to 17-007 to do SYNC TEAM only --------------------------------------- [213:2] 11.6.6 SYNC TEAM statement, R1169 sync-team-stmt, Change "" to "". [213:2+] Insert new BNF and constraint immediately following R1169 "R1169a <> C1173a A shall be of type TEAM_TYPE from the intrinsic module ISO_FORTRAN_ENV." [213:3] Same subclause, p1, Change "The shall be defined with a value that represents" to "The shall identify" making the whole paragraph read "The shall identify an ancestor team, the current team, or a team whose parent is the current team." {Note cosmetic change in the edit.} [213:5-6] Same subclause, p2, Change "the team specified by " to "the team identified by " {Note cosmetic change in the edit.} 6. Edits to 17-007 to do both CHANGE TEAM and SYNC TEAM ------------------------------------------------------- [187:8] 11.1.5.1 Purpose and form of the CHANGE TEAM construct, R1112 change-team-stmt, Change "" -> "". [187:12] Same subclause, R1115 team-variable, Change " <> " to " <> ". [187:23] Same subclause, C1115 "A team-variable shall", Change "A shall" to "A shall". [188:6,8-9] 11.1.5.2 Execution of a CHANGE TEAM construct, p1 Change "The values of the s" to "The s", Change "specified by the value of " to "identified by ". {Note cosmetic change in the edit.} [188:9-10] Same paragraph, delete now-redundant "The current team is not changed by a redefinition of the team variable during execution of the CHANGE TEAM construct." {Making it an expression removes any such consideration.} ALTERNATIVE: Replace with "If is a variable, the current team is not changed by a redefinition of that variable during execution of the CHANGE TEAM construct." [188:22] Same subclause, p6 Change "identified by " to "identifier by ". [213:2] 11.6.6 SYNC TEAM statement, R1169 sync-team-stmt, Change "" to "". [213:3] Same subclause, p1, Change "The shall be defined with a value that represents" to "The shall identify" making the whole paragraph read "The shall identify an ancestor team, the current team, or a team whose parent is the current team." {Note cosmetic change in the edit.} [213:5-6] Same subclause, p2, Change "the team specified by " to "the team identified by " {Note cosmetic change in the edit.} [214:17+] 11.6.9 FORM TEAM statement, after R1176 team-number, insert new BNF and constraint "R1176a <> C1176a A shall be of type TEAM_TYPE from the intrinsic module ISO_FORTRAN_ENV." {Reinstate BNF for team-variable in the appropriate place.} 7. Supplementary edits for the TEAM= specifier ---------------------------------------------- [139:19] 9.6 Image selectors, R926 image-selector-spec, "TEAM = " -> "TEAM = ". [139:28-29] Same subclause, p3, Change ", which shall be defined with a value that represents" to ", which shall identify" making that sentence read "If a TEAM= specifier appears in an image-selector, the team of the image selector is specified by team-value, which shall identify the current or an ancestor team; the object shall be an established coarray in that team or an ancestor thereof." {Note cosmetic change in the edit.} ===END===