David Leal said:
> If I have the following interface:
>
> interface SAx
> !Do the operation: A*x
> module procedure SAx_A, SAx_A_ip
> end interface
>
> and then I want make a association with the operator *.Which functions I
> have to make this association?
>
> a) With the generic function SAx:
No.
The MODULE PROCEDURE statement requires each name to be the name of
a module procedure; SAX is a generic name and not a module procedure
name so is not allowed (and should give an error at compile-time).
Note that there is a trap here: if SAX is both a generic name and a
module procedure name, using "MODULE PROCEDURE SAX" only brings the
specific module procedure into your new generic set (probably without
any warning from your compiler).
> b) or with each particular functions
> ---------------------------
>
> interface operator(*)
> module procedure SAx_A,SAx_A_ip
> end interface
Yes, this is the correct way.
> c) or the equivalent way
Yes, (b) is equivalent to (c).
Cheers,
--
...........................Malcolm Cohen, NAG Ltd., Oxford, U.K.
([log in to unmask])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|