i := x + y; # this is a comment
j := a - b; # this computes "a + (-b)"
# a comment; still in the comment # and more comment
foo1 _foo1 f_o__o1 foo_1__ _ __ ___1
The semantics of the for statement are identical to those of the
following while statement:
Two new boolean constants are supported, true and
In addition, two boolean operators are introduced, and and
Both operators take boolean expressions as arguments and return a
Both are short-circuiting,
meaning that the second (rightmost) argument is not evaluated if the result
of the first argument fully determines the result.
They are both left-associative,
and and has higher precedence than or;
but and has lower precedence that all other operators.
if a = 0 or x / a > 3 and b then end;
# test parses as "(a = 0) or (((x / a) > 3) and b)"
# if a = 0, then don't evaluate the rest of the test
In the extended language, the following notation references an array
var a:array  of array  of int;
var b: array  of int;
a[i+j] := b[k-1] * 2;
a := b; # This is illegal
b := input; # So is this
procedure foo(var x: int, var y: int, var z: array  of int);
x := x+y;
y := y+x;
x := x*y;
var a: int, b : array  of int;
const c: int = 5;
var d: array  of int;
Arguments of scalar types can be passed by either value or reference.
Arrays must be passed by reference, and as a result var
must precede arrays which are declared as formal parameters.
The size of the array being passed must match the type of the array
The following are legal function declarations:
procedure foo(x:int, y:bool) : int;
foo(foo(3,bar()), i < foo(x+y,bar()));
To return a value from a function, the return statement is used with
an expression. Both forms are captured by
The following illustrates some legal uses of return statements:
if y then return x; end;
return x * 5;