12-173r2 To: J3 From: Van Snyder/Malcolm Cohen Subject: Problems with procedure identifiers and generics Date: 2012 October 17 1. Scope --------- The intention here is to clarify wording, not to change technical content. Some of it might already be OK, but I didn't want to overlook a potential problem. There appear to be some obvious problems, which are corrected here -- or maybe there aren't any problems. 2. Problems ------------ In some places, the requirement for explicit interface is put on procedure names; in others, it's put on procedures. For consistency, apply the requirement to procedures everywhere. According to 12.4.2.1p1, dummy and external procedures can only have explicit interface defined by interface bodies, not by procedure declaration statements. Procedure pointers aren't specified in 12.4.2.1 to have explicit interface. The structure of 12.4.2.1p1 is confusing. According to 16.3.5p1, argument keywords are only allowed if an explicit interface is specified by an interface body, not a procedure declaration statement. Generic identifiers declared within type definitions are not mentioned in 12.5.3.4.1. Procedure pointers are procedures. 3. Edits -------- [12.4.2.1p1 279:11-17] Replace the paragraph: "The interface of a procedure is either explicit or implicit. It is explicit if it is o an internal procedure, module procedure, or intrinsic procedure, o a subroutine, or a function with a separate result name, within the the scoping unit that defines it, or o a procedure declared by a procedure declaration statement that specifies an explicit interface, or by an interface body. Otherwise, the interface of the identifier is implicit. \obs{The interface of a statement function is always implicit.}" [C1207 281:8] A is not a procedure. Replace "be" by "denote". [C1208 281:9] A is not a procedure. Replace "be ... as" by "denote". [12.4.3.4.1 Note 12.6+ 284:1-] Generic identifiers can also be declared in type definitions. Insert a note: "NOTE 12.6a A within a derived type definition (4.5.5) specifies a generic identifier for a set of type-bound procedures." [12.4.3.4.5p1 285:13] It's the procedure, not its name that is accessed. Delete "name". [12.4.3.6p6-5 288:2,4-5,8,9-10] Procedure pointers are procedures. Replace "procedures or procedure pointers" by "procedure entities" four times. [12.5.1 C1227 289:22] A generic identifier is not a procedure name. C1227 prohibits referencing procedures using generic names. A procedure pointer is the name of a procedure. Insert "a generic name or" after "shall be". Delete "or procedure pointer". [12.5.2.9p7 298:25] It's the procedure, not its name, that is the actual argument. Delete" name" twice. [12.6.2.6p10 310:25-26] It's the procedure, not the name, that's referenced and has dummy arguments. Replace "procedure name referenced" by "referenced procedure". [12.6.2.6p11 310:29] It's the procedure, not the name, that's referenced and has dummy arguments. Replace "procedure name referenced" by "referenced procedure". [16.3.5p1 442:4] A dummy argument cannot be used as a keyword if the interface is declared by a procedure declaration statement. After the first sentence, insert "As an argument keyword, the name of a dummy argument of a procedure declared by a procedure declaration statement that specifies an explicit interface has a scope of the scoping unit containing the procedure declaration statement." [16.3.5p1 442:5] It's the procedure, not the interface body, that is accessible. Delete "or interface body".