To: J3 J3/25-138 From: generics Subject: Edits for TEMPLATES: REQUIREMENT and REQUIRE Date: 2025-May-19 References: 25-111, 25-135, 25-136, 25-137, 24-125r5, 24-126r4, 24-127r4 Introduction ============ This is the 4th of 6 papers that provide edits for the approved syntax for templates. Straw vote: The REQUIRE statement does not need "[::]" at this time, but we note that various other bits of the BNF also have unnecesary optional "[::]". E.g., various attribute specification statements: DIMENSION, INTENT, SAVE, ... Should "::" be removed from the BNF for the REQUIRE statement? YES - omit the optional "[::]" in the BNF NO - keep the optional "[::]" in the BNF ABSTAIN Section 1 ========= * Append the following at the end of the clause from paper 25-137. tt.6 REQUIREMENT construct A REQUIREMENT is a named collection of deferred argument declarations intended to facilitate reuse of common patterns within templates and other requirements. A REQUIREMENT construct is a specification construct and a scoping unit. Rtt30 <> REQUIREMENT ( [] ) [ ] ... ... END [REQUIREMENT []] Ctt63 (Rtt30) A shall only appear in the of a main program or module. Ctt65 (Rtt30) If a appears in the , it shall be identical to the specified in the . Rtt31 <> <> Ctt66 (Rtt31) The within an shall include ABSTRACT or DEFERRED. NOTE Each is local to the REQUIREMENT construct. tt.7 REQUIRE statement A REQUIRE statement provides specifications of deferred arguments by associating them with the deferred arguments of a REQUIREMENT. A REQUIRE statement is a specification statement. Rtt32 <> REQUIRE [::] ( [] ) Ctt67 (Rtt32) A shall be the name of a REQUIREMENT that is ultimately defined prior to the . NOTE 1 Instantiation arguments in a REQUIRE statement are not required to be deferred arguments. NOTE 2 An instantiation argument that appears in a REQUIRE statement is only given an ultimate specification if it is a deferred argument of the scoping unit in which the REQUIRE statement appears. See tt.2.2.1. {tt.2.2.1 is "General" in consistency.txt} NOTE 3 Examples of REQUIREMENT and REQUIRE: REQUIREMENT R1(U, V, G) DEFERRED TYPE :: U, V DEFERRED INTERFACE FUNCTION G(X) TYPE(U), INTENT(IN) :: X TYPE(V) :: G END FUNCTION END INTERFACE END REQUIREMENT REQUIREMENT R2(U, G) REQUIRE R1(U, U, G) END REQUIREMENT Example REQUIRE statements for the above requirements are shown below, which could appear together in the same template, although they are redundant in this case. REQUIRE R1(T, T, F) REQUIRE R2(T, F) ===END===