PROCEDURE declarations
Tobias Burnus
burnus@net-b.de
Tue Aug 21 15:44:00 GMT 2007
Janus Weil wrote:
> 2007/8/20, Tobias Burnus <burnus@net-b.de>:
>
>> In TYPE there one can also have PROCEDURE but this requires the
>> attribute POINTER:
>>
>> PROCEDURE([type]) [, attributes :: ] name
>>
>> and I would suggest to defer this until you start with procedure pointers.
>>
> I don't think this is true. You can also have a PROCEDURE in TYPE,
>
Well, seemingly I was too short: For the type parameter part (before the
CONTAINS) R445 applies and you have: C449 "POINTER shall appear in each
proc-component-attr-spec-list".
> since the standard allows "type-bound procedures"
Whereas for the type-bound procedures you are right, the POINTER is not
required.
Still, I think you should leave out PROCEDURE in TYPE _for_now_ as
neither PROCEDURE(...), POINTER nor type-bound precedures are currently
supported.
> This is an important use of PROCEDURE, and I definitely want to implement it.
>
Well, my point was not that you should not implement all uses of
PROCEDURE but my suggestion was to get first all PROCEDURE statements
running, which neither require POINTER nor type-bound procedures. When
this works, one can implement procedure points (to make Joost happy, who
uses them in CP2k) and then finally type-bound procedures. (Let's see
whether gfortran will be the first compiler I have which supports both
type-bound procedures and procedure pointers; NAG f95 supports the
former, g95 the latter.)
Other than that, type-bound procedures are cool and I find it great that
you plan to implement them.
Tobias
More information about the Fortran
mailing list