J3/04-112 Date: 08 Dec. 2003 To: J3 From: Dan Nagle Subject: DO UNTIL While some may argue that one more form of do loop is redundant, nevertheless several compilers support it. This argues in favor of its inclusion in a future standard. Number: Title: DO UNTIL Submitted By: J3 Status: For Consideration References: Section 8.1.6 Basic Functionality: DO UNTIL Rationale: Many programming languages have a post-loop-test iteration form, several Fortran compilers support the DO UNTIL form, and some programming problems fit naturally into a post-loop-test scheme, for example, reading until end-of-file. The argument against DO UNTIL is that the same functionality is available via the appropriate combination of do forever and exit. However, any loop may be replaced by do forever and exit. Furthermore, Fortran is an array-and-iteration oriented language, it seems difficult to argue against Fortran being rich in iteration structures. Estimated Impact: For many compilers, the impact is none (they already support DO UNTIL), for others, the impact will be minor, they support the functionality using a different syntax. Detailed Specification: DO UNTIL has the form: [name:] DO UNTIL( s-l-e ) ! loop body here ENDDO [name] The scalar logical expression is evaluated "at the enddo statement", so it's operands need not be defined prior to the DO UNTIL statement. That is, the operands may get their values during execution of the loop body. History: