07-239r1 To: J3 From: Van Snyder Subject: Syntax cleanup (specification exprs) Date: 2007 August 7 -------------------------------------------------------------------------- [167:34] Everywhere one is allowed to access a function, one can access it by a defined operation ... EXCEPT in a specification expression. Example: subroutine S ( L ) use M, only: MyList, operator(.len.) type(myList), intent(in) :: L ! integer :: Work(MyLen(L)) ! Only ok in the module... integer :: Work(.len.L) ! Not ok in this line print *,.len.L ! But ok in this line ... end subroutine S See UTI 122. If we agree that it's reasonable to access intrinsic functions such as ALLOCATED directly rather than needing to disguise them within specification functions, why do we have to hide defined operations inside specification functions (when the defined operation just invokes a pure function)? Editor: Insert "or defined by a specification function" after "operation is intrinsic". module M public private MyLen type MyList ... end type MyList interface operator ( .len. ) module procedure MyLen end interface contains pure integer function MyLen ( Arg ) type(myList), intent(in) :: Arg ... end function MyLen end module