To: J3 J3/14-101r1 From: Steve Lionel Subject:type-spec for ac-do-variable Date: 2014 January 24 Reference: 14-007 Fortran 2008 added the ability to optionally specify the type of the index-name directly in a forall-header (R752), allowing the programmer to specify the type of this construct entity at the point where it is created, rather than inheriting the type from the enclosing scope. This applies to FORALL and DO CONCURRENT. This feature was not also applied to the ac-do-variable in an array constructor implied-DO (R473), which, as a statement entity it would also benefit from the option of local type specification. This omission creates an asymmetry in the language that should be corrected in the next standard. A similar case can be made for the data-i-do-variable in data-implied-do (R539), which is also a statement entity. Note that io-implied-do does not create a statement or construct entity, so this issue does not apply there. Suggested edits, in reference to 14-007, are provided to correct this defect. EDITS to 14-007: [87:3] 4.8, R473 Replace R473 with: R473 ac-implied-do is ( ac-value-list, [type-spec ::] ac-implied-do-control ) Alternatively, the optional type-spec could be added to R474, but the edits to 16.4 are cleaner if it's R473. Insert new constraint C4110a C4110a (R473) type-spec in ac-implied-do shall specify type integer Consider also qualifying the references to type-spec in C4105, C4106 and C4107 (all for R469) so as to reduce possible confusion with the different type-spec applying to R473. In C4105, 4106, 4107: replace "type-spec" with "type-spec in ac-spec" [107:11-14], 5.4.7, R539 Replace R539 with: R539 data-implied-do is ( data-i-do-object-list, [type-spec ::] data-i-do-variable = scalar-int-constant-expr, scalar-int-constant-expr [, scalar-int-constant-expr] ) Insert new constraint C572a C572a (R539) type-spec shall specify type integer [448:25-31] 16.4 Replace the second sentence of paragraph 4 with the following two sentences: It is a scalar variable. If type-spec appears in data-implied-do or ac-implied-do, the variable has the specified type and type parameters; otherwise it has the type and type parameters that it would have if it were the name of a variable in the innermost executable construct or scoping unit that includes the DATA statement or array constructor, and this type shall be integer type; it has no other attributes. SUBMITTED BY: Steve Lionel