This is intended as a survey.
Fortran 90 allows us to initialize variables, a nice and useful feature but
initialized variables are automatically SAVEd.
I find this rule somewhat annoying and even potentially dangerous in
parallel and object-oriented programming.
When calling a procedure with an initialized variable, e.g. to set proper
default values (which is probably the right way of thinking about initial
values in most cases), any change to this variable SAVEs the new value.
At any subsequent call this new value is used. However, it is not always
clear in which order procedure calls will occur and so I have to revert to
the old style and initialize variables in separate statements to enforce
the defaults.
In my view the default SAVE rule should be scrapped. If the variable must be
saved, an explicit SAVE can be added as an attribute. This seems to be a much
cleaner and safer solution.
What are your opinions about this? If there is overwhelming support for my
position could the standard by changed? What arguments speack against my
position (beyond backward compatibility)?
Cheers,
WWS
-----------------------------------------------------------------------
| Werner W Schulz |
| Dept of Chemistry email: [log in to unmask] |
| University of Cambridge Phone: (+44) (0)1223 336 502 |
| Lensfield Road Secretary: 1223 336 338 |
| Cambridge CB2 1EW Fax: 1223 336 536 |
| United Kingdom WWW: |
-----------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|