Within the program's main routine and subroutines, the flow of execution is controlled using call, rcall, if, and for statements.
(rcall subname arg arg ...)
(call subname arg arg ...) or
A call or rcall statement is used to call a subroutine either forwards or in reverse, with arguments. If a particular actual argument is a variable or a memory reference, then the subroutine may actually change the value of its corresponding formal argument, and the caller will see the new value after the call is completed. If the argument is a constant or an expression, then it is an error for the subroutine to return with the corresponding formal argument having a value that is different from the value that the constant or expression evaluates to after the return. (Nonsensical behavior will result.)
Rcall differs from call only in that with rcall, the subroutine body is executed in the reverse direction from the direction in which the rcall is executed.
statement
statement ...)
(if ¯ condition then
An if statement conditionally executes the body statements if the condition expression evaluates to a non-zero value. If the value of the condition expression ever has a different value at the end of the body from the value it had at the beginning, then program behavior after that point will in general be nonsensical.
The top-level operation in the condition expression may be a normal expression operation, or one of the relational operators =, <, >, <=, >=, != which have the expected C-like meanings of signed integer comparison. These relational operators are not currently supported for use in expressions in contexts other than the top-level expressions in if conditions.
Actually the compiler does not yet moment support all the different relations with all of the possible types of arguments even in if conditions. The if implementation in the compiler needs some major rewriting.
In the future, if statements will also be allowed to appear in forms
containing else clauses, using the syntax
if-statement if-statement ...
else
else-statement else-statement ... ) ,
(if ¯ condition
but currently this form of if is not yet implemented by the compiler.
statement
statement ...)
(for ¯ var = start to end
A for statement performs definite iteration. Var must not exist as a variable at the point where the for construct appears, but it may exist as a name of a static data element, in which case this meaning will be shadowed during the for.
Before the loop, the start and end expressions are evaluated, and var is bound to the value of start. The scope of var is the body of the for. On each iteration, the body statements are executed. After each iteration, if var is equal to the value of end which was computed earlier, the loop terminates; otherwise, var is incremented as a mod- integer and the loop continues. After the loop, the start and end expressions are evaluated again in reverse to uncompute their stored values.
It is an error for either the start or end expressions to evaluate to different values after the loop than they do before the loop. If they do, program behavior afterwards will be nonsensical. The same goes for any of their subexpressions.
Note that although for is intended for definite iteration, in which the number of iterations is always exactly the difference between the initially-computed start and end values, actually there is nothing to prevent the value of var from being modified within the body, so that the number of iterations can actually be determined dynamically as the iteration proceeds. One can thus construct ``while''-like indefinite iteration functionality using for as a primitive. However, this is inconvenient, so the language will eventually explicitly include a while-like construct, though it does not do so currently.