J3/17-233 To: J3 From: Malcolm Cohen Subject: Comments 10, 57, 67: Recursion and CHARACTER*(*) functions Date: 2017 October 15 1. Introduction CHARACTER*(*) functions are not permitted to be recursive, see C724. This causes contradictions with the Introduction and elsewhere. There are several possible resolutions, e.g. (1) permit CHARACTER*(*) functions to be recursive, (2) remove CHARACTER*(*) functions from the "default recursive" feature. Option (1) is plausible, but improves an obsolescent feature, and would be a new feature. Option (2) is the simplest solution which removes the contradiction without introducing anything new. Also, C724 is badly worded: "recursive" means that a procedure is invoked whilst already executing. That is a runtime condition, inappropriate for a constraint. The correct wording for a compile-time constraint is "have the RECURSIVE attribute". Also, the comment in the Introduction about default recursive makes an unnecessary remark about elementals. This can be deleted to simplify. Comments 10, 57 and 67 are all this same issue with CHARACTER*(*). 2. Edits to 17-007r2 (N2137) [intro] In the bullet item "Program units and procedures", change "Procedures, including elemental procedures, " to "Procedures \obs{that are not declared with an asterisk }", making the whole sentence read "Procedures that are not declared with an asterisk can be invoked recursively by default; the RECURSIVE keyword is advisory only.". {Remove default recursive from CHARACTER*(*). Also delete unnecessary remark about elementals.} [66:11] 7.4.4.2 Character type specifier, C724, Delete "recursive," and append a new sentence in obsolescent font "A function name declared with an asterisk shall not have the RECURSIVE attribute.". {Correct constraint.} [330:16] 15.6.2.1 General, p3, append, in obsolescent font, "A function name declared with an asterisk \si{type-param-value} shall not directly or indirectly invoke itself or any other procedure defined by the subprogram.". {Remove default recursive from CHARACTER*(*).} ===END===