J3/01-134 Date: 13 February 2001 To: J3 From: Van Snyder Subject: Minor defect in definition of "present" NUMBER: ? TITLE: Definition of "present" is defective KEYWORDS: present, dummy argument DEFECT TYPE: loophole? STATUS: J3 consideration in progress DISCUSSION Subclause 12.4.1.5 begins with a definition of the term "present": "A dummy argument is present in an instance of a subprogram if it is associated with an actual argument and the actual argument either is a dummy argument that is present in the invoking scoping unit or is not a dummy argument of the invoking scoping unit." This is defective in that if the actual argumement is a dummy argument that is accessed by host association, it is not a dummy argument OF the invoking scoping unit, and therefore although it may be "not present" in the procedure of which it is a dummy argument, it is nonetheless "present" in an internal procedure of that procedure. EXAMPLE: module M contains subroutine S1 ( A ) integer, optional :: A call S11 contains subroutine S11 call S12 ( A ) end subroutine S11 subroutine S12 ( B ) integer, optional :: B if ( present(B) ) print *, 'B is present' end subroutine S12 end subroutine S1 end module M program P use M, only: S1 call S1 end program P According to the above-cited definition, this program ought to print B is present because the dummy argument B of S12 is associated with an actual argument A that is not a dummy argument of the invoking scoping unit S11. EDITS: In the third line of subclause 12.4.1.5 [202:45 in 97-007r2], either replace "of" by "in" or delete "of the invoking scoping unit". SUBMITTED BY: Van Snyder HISTORY: 01-134 m156 Submitted