[J3] Is this standard-conforming?
Malcolm Cohen
malcolm at nag-j.co.jp
Fri Jul 27 03:00:17 EDT 2018
> but I can't find anything that requires them to accept it. Doesn't mean
>it's not there, just that I can't find it.
It is the scoping rules. The scope of a local identifier is an inclusive scope, which in this case is the scoping unit. The scoping unit includes the FUNCTION statement. There are no ordering rules being violated.
QED.
This is where adding so-called “clarifying” text can be actually harmful, as there is inevitably always a multitude of cases some of which will not have “clarifying” text and so people think the cases we didn’t tediously list are invalid. Not so.
There does need to be specific text precisely, and only, for the locally-defined derived type name used in a FUNCTION statement, because otherwise it is invalid to declare any non-pointer entity of that type before its type definition.
Fortran is not a declare-before-use language except where there are explicit ordering rules.
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20180727/0f9bdf4d/attachment.html>
More information about the J3
mailing list