To: J3 J3/24-159r1 From: Brad Richardson Subject: Syntax for Instantiation of Standalone Template Procedure Date: 2024-September-23 Reference: 24-126r4 1. Introduction =============== The current syntax for instantiation of a standalone template procedure when not using the inline instantiation syntax makes use of the INSTANTIATE statement and requires that the procedure be renamed so that it does not have the same name as the template. This assumes that not only does the instantiated procedure have a name, but that it is the same as the template name. It also results in a syntax for the statement that appears redundant. For example INSTANTIATE tmpl_proc(...), new_name => tmpl_proc This paper presents some alternatives for the above syntax. 2. Syntax Options ================= The following are some possibilities for alternative syntax for advance instantiation of standalone template procedures. These alternatives do not imply that the instantiated procedure has a name, let alone what that name is. A. INSTANTIATE tmpl_proc(...) => new_name B. INSTANTIATE tmpl_proc(...) as new_name C. INSTANTIATE tmpl_proc(...) <= new_name D. new_name => INSTANTIATE tmpl_proc(...) E. procedure(), parameter :: new_name = tmpl_proc^(...) F. INSTANTIATE tmpl_proc(...), [ONLY :] new_name => * It is noted that option A, while concise, clear and somewhat intuitive, has the order of entities reversed from the usual rename syntax. Option B corrects that defect by introducing a new keyword. Option C is effectively a variation on B, but using the less than or equal to operator. Option D is likely to be indistinguishable syntactically from a pointer assignment statement in some contexts. Option E expands on the procedure declaration statement in a new way, but the use of the parameter keyword (implying named constant) may be inappropriate in this context. Option F simply uses something other than a name for the use-name. Variations on the above examples are certainly also possible and worth considering.