Re: save statement in a module
- From: "James Giles" <jamesgiles@xxxxxxxxxxxxxxxx>
- Date: Tue, 10 Jun 2008 03:38:59 GMT
Gib Bogle wrote:
....
What is the effect of the module-level SAVE? I thought all module
variables were automatically SAVEd.
Nope. That's what I've usually argued *should* be the rule,
but Fortran doesn't say that. Unless you have the save attribute,
all module variables become officially undefined when the
last USE for the module (the one highest in your call sequence)
goes out of scope.
Having to remember whether a module USE is still in scope
or not is something many users are not particularly good at.
Those that *can* keep track of such things would rather
not be required to do so. That's why I think module variables
should always be considered SAVEd. The definition of
Fortran should be changes to require it.
--
J. Giles
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
.
- Follow-Ups:
- Re: save statement in a module
- From: Tobias Burnus
- Re: save statement in a module
- From: Ron Ford
- Re: save statement in a module
- References:
- save statement in a module
- From: jel
- Re: save statement in a module
- From: Craig Powers
- Re: save statement in a module
- From: Richard Maine
- Re: save statement in a module
- From: Gib Bogle
- save statement in a module
- Prev by Date: Re: The linf project (2)
- Next by Date: Re: save statement in a module
- Previous by thread: Re: save statement in a module
- Next by thread: Re: save statement in a module
- Index(es):
Relevant Pages
|
|