MTS 8: LISP and SLIP in MTS
June 1976
world and affect the course of the computation. It uses the prompting
character (=) to indicate it is ready to accept input for evaluation, in
the same way as the top level of LISP uses "*". The user may type in an
expression for evaluation and the value will be printed out, followed by
another (=). Or the user can type in one of the commands described
below which are specifically recognized by BREAKFUNCTION. Since BREAK-
FUNCTION puts all of the power of LISP at the user’s command, anything
that can be done at the top level of LISP can be done with BREAKFUNC-
TION. For example, one can define new functions or edit existing ones,
set breaks, or trace functions. The user may evaluate an expression,
see that the value was incorrect, call the editor, change a function,
and evaluate the expression again, all without leaving the break.
It is important to emphasize that once a break occurs, the user is in
complete control of the flow of the computation, and the computation
will not proceed without specific instruction. Only if the user gives
one of the commands that exits from the break (GO, OK, RETURN, FROM)
will the computation continue. The computation can also be aborted
(using # or ##, which are defined later in this section).
Note that BREAKFUNCTION is just another LISP function, not a special
system feature like the interpreter or the garbage collector. It has
arguments and returns a value, like any other function. A call to
BREAKFUNCTION has the form
(BREAKFUNCTION BREAKEXPR BREAKWHEN BREAKFN BREAKCMDS BREAKTYPE)
BREAKWHEN This argument is a LISP function which is evaluated to
determine if a break will occur.
BREAKEXPR BREAKEXPR is a form to be evaluated by BREAKFUNCTION.
If BREAKWHEN returns NIL, BREAKEXPR is evaluated and
returned as the value of the break. If BREAKWHEN
returns any other value, a break occurs. After a
break occurs, the commands GO, OK, and EVAL (see
command descriptions) cause BREAKEXPR to be evaluated.
BREAKFN This argument is the name of the function being
broken. BREAKFN is used to print the above message
when a break occurs.
BREAKCMDS This argument is a list of command lines which are
executed immediately, in the event of a break. The
command lines on BREAKCMDS are executed before com-
mands are accepted from the terminal, so that if one
of the commands on BREAKCMDS causes a return, a break
occurs without the need for user interaction.
BREAKTYPE This argument identifies the type of break. It is
used primarily by the Error Package. In all cases the
user can use BREAK for this argument.
102 LISP Debugging Facilities