Re: NAG, Sun, Compaq possible f95 bug
From: Richard Maine (nospam_at_see.signature)
Date: 02/03/04
- Next message: Richard Maine: "Re: NAG, Sun, Compaq possible f95 bug"
- Previous message: TLowe: "Re: Size of Largest Array?"
- In reply to: glen herrmannsfeldt: "Re: NAG, Sun, Compaq possible f95 bug"
- Next in thread: Richard Maine: "Re: NAG, Sun, Compaq possible f95 bug"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 03 Feb 2004 08:13:19 -0800
glen herrmannsfeldt <gah@ugcs.caltech.edu> writes:
> Also, the range of a DO loop does not include the DO statement
> itself. Would the scope include the DO?
Range of a DO loop and scope are different (as you allude).
The variable of an "ordinary" DO loop has scope of the
scoping unit that the DO appears in; this is considerably more
than the range of that DO loop. That point is important, as
the variable gets its initial value from statements that are
nefore the DO loop; they are outside of the range of the DO
loop, but in the scope of th evariable.
The scope of an ac-implied-do variable is the ac-implied-do, which
syntactically, includes the whole thing, including the limit
expressions. That's why the limit expressions can't use the
"i" from outside the ac-implied-do; that one isn't in scope.
P.S. People presumably understand, but when I earlier said that
CVF was right, that wasn't mean to say that Lahey was nonconforming
in this regard. The code in question was nonconforming (but doesn't
violate a numbered syntax rule or constraint or any of the other
things requiring diagnosis), and thus the compiler is allowed to
do anything with it. CVF was correct in diagnosing the error,
but Lahey cannot strictly said to be incorrect in giving it some
extended interpretation (I'd say Lahey's behavior was undesirable,
but does not constitute a nonconformance of the compiler.)
-- Richard Maine | Good judgment comes from experience; email: my first.last at org.domain | experience comes from bad judgment. org: nasa, domain: gov | -- Mark Twain
- Next message: Richard Maine: "Re: NAG, Sun, Compaq possible f95 bug"
- Previous message: TLowe: "Re: Size of Largest Array?"
- In reply to: glen herrmannsfeldt: "Re: NAG, Sun, Compaq possible f95 bug"
- Next in thread: Richard Maine: "Re: NAG, Sun, Compaq possible f95 bug"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|