REDUCE

Statements

A statement is any combination of reserved words and expressions, and has the syntax

statement ::= expressionproper statement

A REDUCE program consists of a series of commands which are statements followed by a terminator:

terminator ::= ;$

The division of the program into lines is arbitrary. Several statements can be on one line, or one statement can be freely broken onto several lines. If the program is run interactively, statements ending with ; or $ are not processed until an end-of-line character is encountered. This character can vary from system to system, but is normally the Return key on an ASCII terminal. Specific systems may also use additional keys as statement terminators.

If a statement is a proper statement, the appropriate action takes place.

Depending on the nature of the proper statement some result or response may or may not be printed out, and the response may or may not depend on the terminator used.

If a statement is an expression, it is evaluated. If the terminator is a semicolon, the result is printed. If the terminator is a dollar sign, the result is not printed. Because it is not usually possible to know in advance how large an expression will be, no explicit format statements are offered to the user. However, a variety of output declarations are available so that the output can be produced in different forms. These output declarations are explained in Section 8.3.3.

The following sub-sections describe the types of proper statements in REDUCE.

 5.1 Assignment Statements
 5.2 Group Statements
 5.3 Conditional Statements
 5.4 FOR Statements
 5.5 WHILE …DO
 5.6 REPEAT …UNTIL
 5.7 Compound Statements