Fortran95/2003 Explained 17.8 より。
ソースコード
!===================================== ! 17.8 MODULE m_test INTERFACE OPERATOR(.abe.) MODULE PROCEDURE abe END INTERFACE CONTAINS !----------------------------------- REAL FUNCTION abe(x) REAL, INTENT(IN) :: x abe = -x RETURN END FUNCTION abe !----------------------------------- END MODULE m_test !===================================== PROGRAM test USE m_test, ONLY: OPERATOR(.takakazu.) => OPERATOR(.abe.) IMPLICIT NONE REAL :: x INTEGER :: i DO i = 1, 10 x = REAL(i) PRINT *, .takakazu. x END DO STOP END PROGRAM test