Type-bound procedure and procedure pointer component calls
Daniel Kraft
d@domob.eu
Sun Aug 24 20:09:00 GMT 2008
Tobias Burnus wrote:
> Hello Daniel, hello Janus, hi all,
>> I have to admit that I don't quite know what
>>
>> PROCEDURE(cos) :: foo
>>
>> above means.
>
> procedure(interface) :: proc
> declares an external procedure "proc" with the same interface as
> "interface". The clue is that it also works (in principle) with
> intrinsic (specific) procedures. Thus
> intrinsic cos
> procedure(cos) :: foo
> should be identical to
> intrinsic cos
> interface
> function foo(x)
> real :: x ! Or: "real, intent(in) :: x"
> end function foo
> end interface
> which is the same interface as defined in the Fortran standard for COS
> (incl. the dummy argument name "x").
Thanks for the explanation, that makes sense.
>> Does this establish an explicit interface for foo? If so,
>> foo's symbol's if_source is probably still not set to IFSRC_IFBODY. How
>> do I know about this interface then, so I can adapt the check accordingly?
>
> That's a question to Janus. In principle the two versions above should
> behave identically. If they don't do so then there is a bug in Janus'
> PROCEDURE implementation.
Probably I'm doing something wrong in the type-bound procedures patch,
but with the extensive version above I only get the not-yet-implemented
error, with the PROCEDURE version I also get the "must be a module
procedure or explicit interface" error, so those two can't be totally
equivalent at least as far as gfc's internals are concerned.
Janus, how do I know a symtree got an interface through PROCEDURE?
Daniel
--
Done: Arc-Bar-Cav-Sam-Val-Wiz, Dwa-Elf-Gno-Hum-Orc, Law-Neu-Cha, Fem-Mal
To go: Hea-Kni-Mon-Pri-Ran-Rog-Tou
More information about the Fortran
mailing list