To: J3 J3/24-159r3 From: Brad Richardson Subject: Syntax for Instantiation of Standalone Template Procedure Date: 2024-October-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(...), [ONLY :] new_name => * B. INSTANTIATE tmpl_proc(...) as new_name C. procedure(), parameter :: new_name = tmpl_proc^(...) D. INSTANTIATE :: new_name => tmpl_proc(...) Option A simply uses something other than a name for the use-name, allowing the instantiation to still appear similar to instantiation of a regular template. Option B introduces a new keyword, eliminating the need to specify any name. Option C expands on the procedure declaration statement in a new way, but the use of the parameter keyword (implying named constant) may seem inappropriate in this context. Variations on the above examples are certainly also possible and worth considering. It may also be worth considering requiring the ^ character in any or all of the possible options. Straw Vote ========== Which of the above options should be used as the syntax for instantiation of standalone template procedure where it is not immediately called or passed as an actual argument?