J3/03-228 Date: 04 August 2003 To: J3 From: Malcolm Cohen Subject: A hasty technical decision Re: WG5/N1572 ISO/IEC JTC1/SC22/WG5 N1572 To: WG5 From: Malcolm Cohen Subject: A hasty technical decision 1. Introduction Earlier in the meeting we took the decision to require redeclaration of separate module procedures without adequate discussion and despite knowing that this was un acceptable to some members of WG5. The reason given was that it was too complicated to specify. I wish to register my dissent from that decision, and to dispute the reasoning. Sample edits to implement allowing the user to omit redeclaration follow. As I am only one person working for a couple of hours (not a subgroup for a week), this is less polished than N1555 and the technical decisions (e.g. syntax, result name) have not been reviewed. Nonetheless, I believe that this more than adequately illustrates the feasibility of the approach. 2. Edits to N1555 4th draft [3:1] After "it" insert "may redeclare the characteristics, dummy argument names, whether it is recursive, and binding label. If any of these are redeclared it" {Remove textual requirement for redeclaration.} [3:5] After "function" insert "and its characteristics are not redeclared, the result variable name is determined by the FUNCTION statement in the module procedure interface body. Otherwise" {Allow the non-redeclarative form to take its result name also from the declaration; for the redeclarative form the redeclaration continues to take precedence.} [3:6-8] Delete "If ... characteristics." {Previously unnecessary and redundant witter, now incorrect.} [3:38+] Insert "An alternative declaration of the example submodule POINTS_A shows that it is not necessary to redeclare the properties of the module procedure POINT_DIST. SUBMODULE (POINTS) POINTS_A CONTAINS MODULE PROCEDURE POINT_DIST DISTANCE = SQRT((A%X-B%X)**2 + (A%Y-B%Y)**2 ) END FUNCTION POINT_DIST END SUBMODULE POINTS_A " 3. Additional material for the "Edits for ISO-IEC 1539-1" subclause [281:21+] Insert "<> MODULE PROCEDURE [ ] [ ] [ ] C12xx (R1223) The after MODULE PROCEDURE shall have the same name as a module procedure interface that is declared in the module or submodule in which the subprogram is defined, or in an ancestor of that program unit and be accessible by host association from that ancestor." [282:18] Append "If the function subprogram begins with a MODULE PROCEDURE statement, its FUNCTION statement is the one in its module procedure interface body and its result name, dummy arguments, characteristics, and whether it is recursive, are determined by its module procedure interface body." [284:7+] Same edit as for [281:21+], changing "function" to "subroutine" throughout (in the syntax terms) and changing R1223 to R1231. [284:20] Append "If the subroutine subprogram begins with a MODULE PROCEDURE statement, its SUBROUTINE statement is the one in its module procedure interface body and its dummy arguments, characteristics, and whether it is recursive, are determined by its module procedure interface body." [284:21] After "appear" insert "in the SUBROUTINE statement".