Lawrie Schonfelder wrote:
> On Thu, 10 Aug 2000 09:43:14 +0100 (BST) Malcolm Cohen
> <[log in to unmask]> wrote:
> > If one is going to make constructs effectively into scoping units, one
> > might as well go whole hog and allow them to have declarations of variables
> > local to the construct.
> Hear! Hear! Now that would be a truely great idea and only about 40 years
> after the concept was invented!
This always seemed a rather obvious improvement to Fortran to me ...
We've lots of code like this:
REAL ZPS ! Need to compute surface pressure in loop at line 600
...
DO I = 1, N
ZPS = <long expression>
X(I) = <another long expression involving ZPS>
ENDDO
which would be much clearer like this:
DO I = 1, N
REAL ZPS ! Surface pressure
ZPS = ...
...
ENDDO
Of course, using implicit typing we could get rid of the declaration in
the first example, but that's only due to the fact that ZPS is a simple
variable ...
So I thought that there would be a good reason why Fortran doesn't allow
this and now I see e-mails by two luminaries in Fortran Standardization
arguing that this would be a swell idea ?!?!?
--
Toon Moene - mailto:[log in to unmask] - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://g95.sourceforge.net/ (under construction)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|