[net.lang] Re

jbdp@jenny.UUCP (Julian Pardoe) (10/19/85)

> > Syntactically, there's no reason why we couldn't have something like:
> >     IF c THEN DECLARE a : INTEGER; ... ENDIF
>
> As, in fact, you do in Algol68.
>
>    IF c THEN INT a; ... FI

In fact you can do more than that:

   IF INT x; read (x); x < 0 THEN ...x... ELSE ...x... FI

and there is of course the all-purpose WHILE loop:

C Loop Type                    A68 Equivalent
===========                    ==============

while (e) do s;                WHILE e DO s OD

do s while (e);                WHILE s; e DO SKIP OD;

for (;;) {                     WHILE s1; e DO s2 OD;
   s1;
   if (e) break;
   s2;
}


Algol-68: love its syntax (except unlabelled CASEs),
          hate its semantics... (especially MODEs)

Julian Pardoe

-------------

University of Cambridge         Tel:     +44 223 352435 ext. 265
        Computer Laboratory     Arpa:    <@ucl-cs: jbdp@cl.cam.ac.uk>
Corn Exchange Street            Janet:   jbdp@UK.AC.Cam.CL
CAMBRIDGE, CB2 3QG              UUCP:    mcvax!ukc!cl-jenny!jbdp
Great Britain