From hirchert@ccs.uky.edu  Wed Mar 29 15:00:19 2000
Received: from mailhost.ccs.uky.edu (mailhost.ccs.uky.edu [128.163.209.59])
	by dkuug.dk (8.9.2/8.9.2) with ESMTP id PAA21550
	for <SC22WG5@dkuug.dk>; Wed, 29 Mar 2000 15:00:18 +0200 (CEST)
	(envelope-from hirchert@ccs.uky.edu)
Received: from hirchert (hirchert.ccs.uky.edu [128.163.209.36])
	by mailhost.ccs.uky.edu (8.9.1/8.9.1) with SMTP id IAA09585;
	Wed, 29 Mar 2000 08:00:21 -0500 (EST)
Message-Id: <3.0.5.32.20000329080011.007cf850@perseus.ccs.uky.edu>
X-Sender: hirchert@perseus.ccs.uky.edu
X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32)
Date: Wed, 29 Mar 2000 08:00:11 -0500
To: helbig@man.ac.uk (Phillip Helbig)
From: "Kurt W. Hirchert" <hirchert@ccs.uky.edu>
Subject: Re: (SC22WG5.1737) Interpretation 001
Cc: SC22WG5@dkuug.dk
In-Reply-To: <200003291018.MAA20681@dkuug.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"

At 12:17 PM 3/29/00 +0100, Phillip Helbig wrote:
>> However, I tried the following code on 4 compilers 
>> (Salford, NAS, Sun's F90 and NAG's F90) and they all assume 
>> that the variable j in the implied DO creates the variable 
>> j. Each gives an error message for the  
>> INTEGER::j statement indicating that j has already been 
>> defined in the scope i.e. it has been exported from the 
>> module.
>
>I assume that they print the value 11 for j?

If I remember correctly, the "j" in the array constructor implied DO has a
scope limited to the implied DO itself, so there is no way to access its
final value of 11.

However, this "j" takes its type and type parameters from the "j" of the
surrounding scope (i.e., the module).  Thus, the question appears to be
whether asking the type and type parameters of the module "j" implicitly
declares one to exist, adding it to the list of variables exported from the
module, or whether the implied DO "j" should have the type and type
parameter the module "j" would have if one were implicitly declared without
actually implicitly declaring one.

In the past, J3 and WG5 have said that if you write something like
      REAL,DIMENSION(MAX(N*N,N+32))::X
in a module, the intrinsic MAX becomes a part of the module, even though it
is isn't explicitly declared.  This suggests to me that J3 and WG5 are
likely to say that the module "j" _is_ implicitly declared in this case,
but I will understand if not everyone sees these cases as being analogous.


However the interpretation comes out, I think the real lesson to take from
this is that unless you are using modules as an _extremely_ bland
replacement for common, you are probably better off overriding the default
accessibility of "public" and then explicitly controlling what you want to
be accessible from your module.
--
Kurt W. Hirchert                          hirchert@ccs.uky.edu
Center for Computational Sciences                +606-257-8748
