- The for-clause of the do-loop is the defining occurence of the
controlled identifier (akin to Fortran's DO-variable); the scope
of this identifier equals the repeating-part (aka loop body),
hence there is no discussion on the value of the DO-variable
after the loop has terminated. The controlled identifier's
type is INT, so it cannot be assigned to. Thus, all do-loops
can much more easily be optimized than similar constructs in
other languages.
I must say that, from a pure algorithmic point of view, the truth lies in
between Algol/Ada and Fortran DO-index treatment.
The DO-variable should ideally be local to the loop;
But what I call "searching"-loops (the extended DO index=... WHILE(...)
of PL/1) necessitates the knowledge of its final value, as in fortran...
Best wishes to the Fortran community,
---------------------------------------------------------
* Patrice LIGNELET *
* Tel: 01 40 27 23 83 Fax: 01 40 27 23 77 *
* 22 58 (Secretariat) *
* Courriel: [log in to unmask] *
* Sur la Toile mondiale (le Ouaibe): *
* http://www2.cnam.fr/~lignelet *
* *
* Conservatoire National des Arts et Metiers *
* Departement d'Informatique *
* 292, rue Saint Martin (\
* 75141 PARIS Cedex 03 ( \
=========================================================) ) />
/ ) / //))/
\ \_/ /////
\ /
\_ /
| |
| |
-----
-----
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|