The examples of how to define your own binary operator in the
language reference (example operators .BAR. and "+") omit to show
where you put the executable lines of code that perform the
function (section 8.9.4). I have tried placing the executable lines of
code in every conceivable place
(e.g. between "FUNCTION MYFUNC(A,B)"
and "END FUNCTION MYFUNC" , which seems logical)
but the compiler kicks it out or says I haven't defined the operator.
Lets look at the .BAR. example provided:
INTEGER, INTENT(IN) :: A_1
INTEGER :: BAR
END FUNCTION BAR
Then it is said you invoke the function when you write
I=4 + (.BAR.B)
But nowhere is it defined what .BAR. does!
Does it square B? Does it do a 1's complement of B?
There has a place to put the executable code that defines what it
does, but the compiler will not accept executable code in an
INTERFACE block, only declarations.
Can anyone provide a clue?