To: J3 J3/24-154 From: Malcolm Cohen Subject: Recommendation on constant expressions for generic resolution. Date: 2024-June-26 References: 24-103. This paper presents the /DATA subgroup recommendations on the proposed constant expressions for generic resolution, paper 24-103. This paper suggests some intriguing possibilities for extending generic resolution in a manner that follows how we have done some of the intrinsic functions, e.g. SIZE. Subgroup considers that those intrinsic functions are not an appropriate model for user-defined generic procedures. The first example in the paper can be done using generic subroutines instead of generic functions, for example, Generic Simple Subroutine get_size(c, cs) Use Iso_Fortran_Env Class(container),Intent(In) :: c Integer(int_kinds),Intent(Out) :: cs cs = Size(c%vals,Kind(cs)) End Subroutine Subgroup further notes that some intrinsic functions use a MOLD argument rather than a KIND argument, to specify the return type and kind. Thus, if functions are preferred over subroutines, one can already write Generic Integer Function size(c) Result(r) Class(container),Intent(In) :: c r = Size(c%vals) End Function Generic Function size(c, mold) Result(r) Class(container),Intent(In) :: c Integer(*),Intent(In) :: mold r = Size(c%vals,Size(mold)) End Function ... Print *,size(c) Print *,size(c,0_int32) Print *,size(c,0_int64) The paper further suggests using character string values in generic resolution, for example call report_info("weather") call report_info("time-of-day") This suggestion fills subgroup with horror. Those procedures can already be written as call report_info_weather call report_info_time_of_day which needs less typing and has been standard-conforming since Fortran 90. Therefore, subgroup recommends that the proposal in 24-103 not be included in Fortran 202y. ===END===