Nothing gets implicitly typed in a BLOCK construct, they always get typed in the "inclusive scope". You can think of that as being the scope ignoring the existence of BLOCK; basically, the innermost subprogram containing it.
That is so that adding a BLOCK-ENDBLOCK in the middle of a subprogram, perhaps in an IF construct, to add an explicitly typed variable local to the BLOCK, does not change the scope of any pre-existing variable. Otherwise BLOCK would be so extremely error-prone as to be unusable without IMPLICIT NONE.
So IMPLICIT simply does not make sense.
The issue with NAMELIST is the same as that of COMMON: in a subprogram, multiple COMMON (or NAMELIST) statements with the same common block name (or namelist group name) add to the common block definition (or namelist definition). It was just thought to be too confusing to have these statements in a BLOCK construct as people would wonder what they were doing.
BTW most discussion takes place at meetings. Sometimes there are papers before or after such discussions which mention rationale, but not always. And the rationale for one person is not necessarily the rationale for another (for example, someone might consider COMMON and NAMELIST to be old-fashioned and undesirable in principle, so prefers not to extend them further). So my stated rationale above is merely my opinion as to what the most important factors in the decisions were - it's common to have multiple factors affecting a decision, and someone else might well think something else was a more important factor.
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
-----Original Message-----
From: Fortran 90 List [mailto:[log in to unmask]] On Behalf Of Vipul Parekh
Sent: Thursday, February 22, 2018 12:03 AM
To: [log in to unmask]
Subject: Re: [COMP-FORTRAN-90] Starting with Fortran 2018, is IMPLICIT statement permitted in a BLOCK construct?
Thanks, I didn't notice the subtle difference is the wording of syntax rules where N2146 elaborates on the block-specification-part with
R1109 and R1107 has:
R1107 block-construct is block-stmt
[ block-specification-part ]
block
end-block-stmt
compared to 10-007r1 which states
R807 block-construct is block-stmt
[ specification-part ]
block
end-block-stmt
Separately, is there any discussion thread anyone knows of re: any prior J3 (or other) communication threads, notes, presos, etc.leading toward the introduction of BLOCK construct in Fortran 2008 that can explain why IMPLICIT and NAMELIST are impossible in a BLOCK construct?
Regards,
Vipul
|