|[8 earlier articles]|
|Re: Testing strategy for compiler firstname.lastname@example.org (glen herrmannsfeldt) (2010-06-19)|
|Re: Testing strategy for compiler email@example.com (Jean-Marc Bourguet) (2010-06-21)|
|Re: Testing strategy for compiler firstname.lastname@example.org (Tony Finch) (2010-06-21)|
|Re: Testing strategy for compiler email@example.com (George Neuner) (2010-06-21)|
|Re: Testing strategy for compiler firstname.lastname@example.org (Andy Walker) (2010-06-22)|
|Re: Testing strategy for compiler email@example.com (Barry Kelly) (2010-06-22)|
|Re: Testing strategy for compiler firstname.lastname@example.org (glen herrmannsfeldt) (2010-06-23)|
|From:||glen herrmannsfeldt <email@example.com>|
|Date:||Wed, 23 Jun 2010 18:18:39 +0000 (UTC)|
|Organization:||Aioe.org NNTP Server|
|References:||10-06-037 10-06-044 10-06-050 10-06-054 10-06-061 10-06-064|
|Posted-Date:||25 Jun 2010 16:24:03 EDT|
Andy Walker <firstname.lastname@example.org> wrote:
> On 21/06/10 22:16, George Neuner wrote:
>> In Pascal it's also illegal to write
>> FOR<var> :=<start> TO<finish> where start> finish
> This is the sort of thing that would drive me *scranny* if I
> were ever forced to use these languages/compilers. You have some
> items to process in order, so you write
> FOR n := 1 TO nitems DO processitem (n) DONE
> What could be more natural? In sensible languages, that works whether
> "nitems" is 1, 100, 100000, ... or 0. If you want better control over
> possible values of "nitems", then you associate that control with the
> declaration of and assignments to "nitems", not with uses of it.
And then our moderator wrote:
> [You wouldn't like Fortran, in which the compiler is allowed to put the
> test at the bottom of a DO loop and always run the loop at least once. -John]
Well, they did change that in 1977.
As far as I know, the original rules were related to the 704 index
registers, kept in later machines. Also, the S/360 BXLE (branch on
index less than or equal) is very convenient for a test at the end DO
Even more, the Fortran rules through Fortran 66 didn't allow negative
or zero values for the start, end, or increment value, and, at least,
the IBM OS/360 compilers enforced that in the case of constants.
Then they might have overdone it in Fortran 77. I sort of like the
option to have UPTO and DOWNTO, specifying the loop direction.
Fortran 77 allows for either either positive or negative variable
increment, requiring more complicated logic at run time. Fortran 77
also pretty much requires the loop increment and limit to be evaluated
at loop entry and used for the duration of the loop.
Also, Fortran 77 allows for REAL (floating point) DO loops,
a feature removed in Fortran 90 and later.
Return to the
Search the comp.compilers archives again.