10-153r2 To: J3 From: Robert Corbett/Stan Whitlock Subject: Interpretation Request: generic resolution with banned argument combinations Date: 2010 June 16 NUMBER: F08/0006 TITLE: generic resolution with banned argument combinations KEYWORDS: intrinsic, generic DEFECT TYPE: interpretation STATUS: J3 consideration in progress QUESTION: The specifications of some intrinsic functions and subroutines explicitly ban certain combinations of arguments, even though those combinations are included in the title and the argument portion of the specification of the function or subroutine. Examples include CMPLX and RANDOM_SEED. Suppose one of those intrinsic functions or subroutines is referenced with one of the banned combinations of arguments. Q1. If the process of generic resolution tries to resolve the reference against the intrinsic, does it resolve the function or subroutine to the intrinsic or should it continue trying to resolve the function or subroutine reference? Q2. For example, given the function reference CMPLX(Z, R) where Z is COMPLEX and R is REAL, should the processor resolve the generic reference to the intrinsic even if it could be resolved to a user-defined function with the same signature later in the process of resolving the reference? Q3. Similarly, given the subroutine call CALL RANDOM_SEED(GET=A, PUT=B) should the processor skip over the intrinsic subroutine to possibly resolve the generic reference against a user-defined subroutine with the same signature? ANSWER: The definition of the interface of an intrinsic consists of its entire description in the standard, not just the names and keywords in the section header of its definition. All of that information must be used to resolve a reference to an intrinsic. A1. No, generic resolution does not resolve to an intrinsic with an illegal combination of arguments. Generic resolution would continue to search user-defined specifics of the generic if they exist. If no match was found, the reference is illegal. A2. No, the given reference cannot resolve to the intrinsic CMPLX. Generic resolution would continue searching for another match in the generic definition if there are any. If no match is found, the reference is illegal. A3. No, the processor cannot resolve the given reference to the intrinsic RANDOM_SEED since the definition of the intrinsic RANDOM_SEED requires exactly one or no arguments. The processor can use whatever means it wishes to reject interfaces that do not match the specified reference. EDITS to 10-007: None. SUBMITTED BY: Robert Corbett HISTORY: 10-153 m192 F08/0006 submitted 10-153r1 m192 Draft answer 10-153r2 m192 Revised answer