On Wed, 9 Aug 2000 09:25:25 -0700 (PDT) Richard Maine
<[log in to unmask]> wrote:
> Jan van Oosterwijk writes:
> > Could anyone of you tell me if it is allowed to use the same name for
> > a Contruct name and a variable name (in the same scoping unit of course).
>
> It is not allowed.
>
> > I have been searching the F90 Standard (14.1)...
>
> That's the right place. In particular, 14.1.2 includes both named
> variables and named constructs (and pretty much everything else) as
> "class 1" local entities. Then a few lines farther down, we have
>
> "Within a scoping unit,a name that identifies a local entity of one
> class must not be used to identify another local entity of the
> same class..."
>
> > Is there a difference between F90 and F95.
>
> No.
>
> --
> Richard Maine
> [log in to unmask]
>
What Richard says is absolutely correct, as usual, but it does not stop it
being totally stupid! Why should there be any artificially imposed name
management issue of this sort. Construct names and variable names are always
contextually and syntactically distinguished. It has always been
incomprehensible to me why they have been willy nilly dumped into the same
catch all class causing additional unnecessary name management problems. In
fact, I can see no good reason why the scope of a construct name should not
be restricted to that of the construct in which it is defined. The name could
then be reused within the same program unit to name similar but
disjoint constructs; something that you very often produce by editing and
repeating code.
This restriction is a piece of Fortran theology that to my mind has little or
no rational basis.
Still the iconoclast!
--
Lawrie Schonfelder
Director, Computing Services Dept.
The University of Liverpool, UK, L69 7ZF
Phone: 44(151)794 3716, Fax: 44(151)794 3759
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|