To: J3 J3/23-185r1 From: T. Clune & subgroup generics Subject: F202Y Use of keywords with deferred procedure arguments Date: 2023-June-13 Reference: 23-155, 23-163 Introduction ============ The introduction of REQUIREMENT/REQUIRES into the feature set for generic programming has exposed an unfortunate issue that requires resolution. More specifically, the use of REQUIRES statements permits multiple specifications of the interface of a deferred procedure whose arguments all have consistent characteristics, and yet have different argument _names_. This then raises the issue of whether keyword association can be used when referencing a deferred procedure. Discussion ========== Subgroup has considered various resolutions to this problem, and none have universal support. The existing syntax paper, 23-155, implicitly disallows use of keywords in references to deferred procedures by virtue of not defining the argument names for the "intersection" of overlapping specifications. This approach is backwards compatible with most of the alternatives and was thus chosen as a safe baseline. Alternative 1: One simple option is to require the programmer to specify an explicit interface (in the specification part of the template) for any deferred procedure that they wish to invoke with keyword arguments. Alternative 2: Require all specifications of a deferred procedure to use the same argument names. This is problematic because we expect individual requirements to be developed independently in many instances. Alternative 3: Allow keyword association when all specifications of a deferred procedure, but otherwise disallow. This is fragile, but at least allows some developers to use keywords in this context. Alternative 4: A final alternative is to add a new keyword/statement that the programmer can use to select one of the interfaces as the one that specifies the keywords. Paper 23-163 provides a more extensive list of pros and cons for the alternatives as well as concrete examples. Proposal ======== Subgroup would like to continue to evaluate alternatives to the baseline syntax with regard to allowing use of keywords in deferred procedure references inside templates. ===END===