To: J3 J3/23-191 From: Mark LeAir & Generics Subject: F202Y Further Refinements of Lower Bounds in Requirements Date: 2023-June-13 Reference: 23-155 Introduction ============ Paper 23-155 introduces the formal syntax for TEMPLATE and REQUIREMENT which are two main constructs in support of the generic programming feature proprosal for F202Y. One unanticipated side-effect of the introduction of REQUIREMENT and its associated REQUIRES statement is that it is possible to give multiple distinct specifications of deferred constants that are consistent in terms of type, kind, and shape, and yet differ with respect to their lower bounds. Currently, paper 23-155 solves this problem by allowing only default lower bounds in REQUIREMENTS. However, the Generics Subgroup wishes to deliberate further on this and possibly relax some associated constraints so arbitrary lower bounds could be used in the REQUIREMENT construct. An Example ========== REQUIREMENT R1(C) INTEGER, CONSTANT :: C(*) END REQUIREMENT R1 REQUIREMENT R2(C) INTEGER, CONSTANT :: C(2:*) END REQUIREMENT R2 TEMPLATE A(C) REQUIRES R1(C) REQUIRES R2(C) CONTAINS SUBROUTINE SHOW() PRINT *, LBOUND(C) ! WHAT IS THE RESULT? END SUBROUTINE END TEMPLATE A Possible Solutions ===================== Alternative 1: Do not allow the specification of the lower bound of a deferred constant in REQUIREMENTS. Alternative 2: Require all lower bounds of a deferred constant to be consistent. Alternative 3: Explicit declaration in the template scope determines lower bound. Proposal ======== Generic Subgroup would continue to evaluate these alternatives for inclusion in F202Y. ===END===