- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(For some history http://software.intel.com/en-us/forums/topic/291295, but please note that I've changed my hair style since that photo was taken.)
The following:
[fortran]
MODULE GiveMeADot
IMPLICIT NONE
PRIVATE
PUBLIC :: OPERATOR(.UnaryOp.)
TYPE, PUBLIC :: MyType
END TYPE MyType
INTERFACE OPERATOR(.UnaryOp.)
PROCEDURE unary_op
END INTERFACE OPERATOR(.UnaryOp.)
CONTAINS
FUNCTION unary_op(arg) RESULT(str)
TYPE(MyType), INTENT(IN) :: arg
CHARACTER(5) :: str
!****
str = 'world'
END FUNCTION unary_op
END MODULE GiveMeADot
PROGRAM StillDotty
USE GiveMeADot
IMPLICIT NONE
TYPE(MyType) :: object
WRITE (*, "(A)") 'Hello ' // .UnaryOp. object
END PROGRAM StillDotty
[/fortran]
(For some reason, omitting the module keyword in the procedure statement gives me a little thrill related to stepping into the brave unknown (perhaps due to the inability to back-level compiler should the need arise...), but I digress...)
gives:
[plain]
>ifort /check:all /warn:all /standard-semantics StillDotty.f90
Intel(R) Visual Fortran Compiler XE for applications running on IA-32, Version 13.0.0.089 Build 20120731
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.
StillDotty.f90(14): remark #7712: This variable has not been used. [ARG]
FUNCTION unary_op(arg) RESULT(str)
--------------------^
StillDotty.f90(26): error #5082: Syntax error, found '.' when expecting one of: .
WRITE (*, "(A)") 'Hello ' // .UnaryOp. object
---------------------------------------^
compilation aborted for StillDotty.f90 (code 1)
[/plain]
The unexpected error about expecting nothing dashes (vs dots) my expectations...
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page