• DO ... UNTIL ... END (indefinite loop). The DO clause contains
the steps to be repeated; the UNTIL clause contains the test that
determines whether to repeat both clauses again (if false) or to exit
• Programs as arguments. Although programs are commonly named
and then executed by calling their names, programs can also be put
on the stack and used as arguments to other programs.
• Evaluation of local variables. The program argument to be executed
repeatedly is stored in a local variable. It's handy to store an object
in a local variable when you don't know beforehand how many
copies you'll need.
MULTI demonstrates one of the differences between global and lo-
cal variables: if a global variable contains a name or program, the
contents of the variable are evaluated when the name is evaluated;
but the contents of a local variable are always simply recalled. Con-
sequently, MULTI uses the local name to put the program argu-
ment on the stack and then executes an explicit EVAL command to
evaluate the program.
Begin the program.
Create a local variable
tains the program argument.
Begin the defining program.
Begin the DO clause.
Make a copy of the object.
Apply the program to the object,
EV AL command is necessary to
execute the program because lo-
cal variables always return their
contents to the stack
Begin the UNTIL clause.
Make a copy of the new version
of the object.
Move the old version to level 1.
Test whether the old version and
the new version are the same.
28: Programming Examples