🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.fortran
Article #6459

Re: Implied do-loop statement, for the next FORTRAN?

#6459
From: Richard Maine
Date: Sun, 04 Mar 1990 17:42
40 lines
2086 bytes
On 3 Mar 90 03:06:41 GMT, Clifton_RL@admdev.cut.oz said:

Clifton> IMPLIED DO-LOOP STATEMENT

Clifton> We could use the implied do-loop construction.  For example:

Clifton> 	(((C(I,J)=A(I,K)*B(K,J) ,K=1,M) ,I=1,M) ,J=1,M)

Clifton> This clear statement would replace the familiar clutter of:

Clifton> 	DO J etc
Clifton> 	 DO I etc
Clifton> 	  DO K etc
Clifton> 	   C(I,J)= etc
Clifton> 	  ENDDO
Clifton> 	 ENDDO
Clifton> 	ENDDO

Clifton> How about it?

Its mostly just a matter of taste (which means others are sure to
disagree), but I find the DO-ENDDO to be clearer than the implied
DO construct you show.  Longer, true, but I wouldn't call it cluttered.
Perhaps it's just because I'm used to it.

The real test comes when things get more complicated.  You showed just
about the simplest possible do loop.  How about when you replace the
inner core with something with multiple statements - perhaps a block
if (or even something with statement labels and G*TO statements :-)).
Or what happens when there are statements in some of the intermediate
level DO's.  Certainly you COULD write such things in an implied DO
notation, but I think they will be very hard to read, particularly
when the loop contents get large enough that the J=1,M or whatever
is several lines below the first reference to the J.  That would mean
you could not read the code sequentially, but would have to scan ahead
to figure out what this J thing was. Possible, but awkward.
--

Richard Maine
maine@elxsi.dfrf.nasa.gov [130.134.64.6]
Technical Details
Message-ID: <MAINE.90Mar4094233@altair.dfrf.nasa.gov>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!jarvis.csri.toronto.edu!rutgers!mailrus!ames!skipper!elxsi!maine
References: <2044.25efa542@admdev.cut.oz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!jarvis.csri.toronto.edu!rutgers!mailrus!ames!skipper!elxsi!maine
From: maine@elxsi.dfrf.nasa.gov (Richard Maine)
Newsgroups: comp.lang.fortran
Subject: Re: Implied do-loop statement, for the next FORTRAN?
Message-ID: <MAINE.90Mar4094233@altair.dfrf.nasa.gov>
Date: 4 Mar 90 17:42:33 GMT
References: <2044.25efa542@admdev.cut.oz>
Sender: news@skipper.dfrf.nasa.gov
Organization: NASA Dryden, Edwards, Cal.
Lines: 40
In-reply-to: Clifton_RL@admdev.cut.oz's message of 3 Mar 90 03:06:41 GMT