.nf .ft CW .ne 12 Closest match between basic features of Turing and Pascal. Turing Pascal \fBDeclarations:\fP .ne 2 const const const x:=e const x=c .ne 2 type type type t:Te type t=Te .ne 2 var x:T var x:T var x:=e var x:Te; .... x:=e .ne 2 procedure procedure function function .ne 3 forward forward forward procedure p(...) procedure p(...); forward body procedure p; ... procedure p; ... .ne 10 \fBTypes:\fP .ne 4 boolean boolean int integer real real string(1) char .ne 2 Subrange: Lo..Hi Lo..Hi .ne 2 Enumerated: enum(a,b,...) (a,b,...) set of T set of T array Lc..He of T array [Lc..Hc] of T .ne 5 record record L :... L :...; L':... L':...; ... ... end record end .ne 5 union t:tagtype of record case {t:} tagtype of label c :... c :(...); label c':... c':(...); ... ... end union end .ne 2 var aCollecn :Collection of T - no equivalent pointer to aCollecn ^T .ne 10 \fBExpressions:\fP .ne 6 + - * / div mod + - * / div mod in, not in in, not(... in ...) ** (exponentiation) =, not =, <, <=, >, >= =, <>, <, <=, >, >= and, or, not and, or, not -> (implies) anEnumType.id id .ne 2 aSetTyp(e) [e] all [lowest..highest] AnArray(i) AnArray[i] aRecd.f aRecd.f .ne 2 aCollecn(p) p^ nil(aCollecn) nil .ne 10 \fBStatements:\fP .ne 2 x := e x := e x += e etc. x := x + e .ne 2 new aCollecn, p new(p) free aCollecn, p free(p) .ne 3 get readln put writeln put e.. write(e) begin ... end begin ... end .ne 5 if ... if ... then ... then ... elsif ... - no equivalent else ... else ... end if - no equivalent .ne 6 case e of case e of label c : ... c : ... label c': ... c': ... ... ... label: ... - no equivalent end case end loop S exit when B end loop repeat S until B loop exit when B; S end loop while not B do S loop S1; exit when B; S2 end loop - no simple equivalent .ne 3 for i :L..H for i := L to H do S S end for - no equivalent .ne 3 for decreasing i:L..H for i:=H downto L do S S end for .ne 2 return - no equivalent result e FuncId := e (but does not return) .ne 2 bind x to v - no equivalent bind f to aRecd.f with aRecd do ... .ft .fi