From: NAME: Jeremy Dudley
FUNC: Process Technology
TEL: 01793 511 711 x 2005 <DUDLEY@SATURNA1@TITAN>
To: SMTP%" [log in to unmask]"@SATURN@MRGATE@TITAN
>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...
Algol 68:
FOR counter FROM start BY step TO stop WHILE logical-expression DO
statements
OD
counter is always integer and unassignable.
If you need the value of counter outside the loop then you
can assign it to another variable - you therefore have control
of that variable's type and scope.
FROM start was optional, and defaulted to FROM 1
BY step was optional, and defaulted to BY 1
WHILE logical-expression was optional and defaulted to WHILE TRUE
FOR .. TO was optional and defaulted to FOR all time
There was some way of having a
DO .. OD construct with an EXIT-style command. No CYCLEs.
A beautiful language, killed off by claims of being too complex
to be efficient. Nearly killed off by claims that a compiler for
the language could not be written, until the Royal College of
Signals wrote one. Still surviving - I used it in 1987 on a Multics
system, and at least one company writing a compiler for it.
I look forward to more discussion about the value of IMPLICIT NONE.
Visual BASIC supports the same. The default is implicit typing, but
an editor switch will insert it as the first statement in each module.
Why change a language when you change the editor instead?
Will the discussion extend to CPL, where the only type was bit string - meaning
defined by context, as was once considered a strength of C and
a weakness of some dialects of BASIC.
Regards to all, and best wishes for Christmas (your God pernitting)
and the New Year.
Jeremy Dudley
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|