To: J3 J3/19-107 From: Van Snyder Subject: Irregularities (index variables) Date: 2019-January-16 Reference: 18-242 Introduction ============ To reduce surprises, especially for newcomers to (modern) Fortran, it would be helpful if facilities that have similar purposes had similar details. The example under attention here is index variables. In , the can be preceded by ::. In , the can be preceded by ::. In , the can be preceded by ::. This is not possible in in or . 18-242 was rejected by /JOR on Monday, October 15 without plenary discussion. The minutes include the remark Seemingly syntax-sugar change would have semantic effect. No value seen. There has in the interim been e-mail discussion that suggests that plenary discussion might have reached a different decision. Proposal ======== To eliminate this irregularity (1) :: should be allowed before the in in , with the additional effect that the becomes a construct entity. Because a with :: is a construct entity, there would be no harm to allow it to have the same name as the of an enclosing DO construct. (2) :: should be allowed before the in . This would have no semantic effect because the is already defined in 19.4p1 to be a statement entity. Because there might be more than one within the same statement, and there is no concept of "the scope of an ," a with :: should not be allowed to have the same name as the of an enclosing . Syntax options for item (1) =========================== There was some objection to simply inserting :: before the in in because this causes the to become a construct entity. Some correspondents remarked that this is a problem. Alternative 1: Allow inserting :: before the in in without additional syntax to warn that the becomes a construct entity. Alternative 2: Allow inserting :: before the in in , with additional syntax, such as parentheses around , to warn that the in in becomes a construct entity. Use Cases ========= allowing do integer :: I = 1, 10 ! blah blah blah end do or do ( integer :: I = 1, 10 ) ! blah blah blah end do avoids requiring block integer :: I do I = 1, 10 ! blah blah blah end do end do (See earlier papers advocating that all constructs ought to have a ). Editorial effects ================= In the discussion of the in in , it would be necessary to specify that if :: appears, the becomes a construct entity. This should be in 19.4p3, not in 11.1.7.2, for consistency with discussion of the scope of the in a , which is specified to be a construct entity in 19.4p3, not in 11.1.7.2. A paragraph similar to 19.4p6 will also be needed. In the discussion of the in , it would be necessary to add paragraphs similar to 7.8p2-3. No new discussion will be necessary in 19.4 because the in is already specified to be a statement entity.