MTS 8: LISP and SLIP in MTS
June 1976
emptied before writing.
(2) If "FDname" has not been used previously in the DSKIN ___
command, the user is prompted for an S-expression designat-
ing the items to be written on "FDname". This S-expression
is evaluated, and returns a list of items which are treated
as follows:
(a) If an item is an atom, it is assumed to be a function
name, and must have a LAMBDA expression as an EXPR on
its property list. The appropriate DEFUN form is
written to "FDname".
(b) If an item is nonatomic, it is written to "FDname" as
is.
"FDname" is emptied before it is written.
100 The LISP Editor

MTS 8: LISP and SLIP in MTS
June 1976
LISP DEBUGGING FACILITIES _________________________
INTRODUCTION ____________
Debugging a collection of LISP functions involves isolating problems
within particular functions and/or determining when and where incorrect
data are being generated and transmitted. There are three facilities
available which augment the facilities of the interpreter for monitoring
a LISP program. One of these is the error package, which takes control
whenever an error occurs in a program, and which allows the user to
examine the environment at the time of the error. The other two
facilities, BREAKF and TRACEF, allow the user to modify selected
function definitions temporarily so that the flow of control in the
program may be followed. All of these facilities use the same LISP
function, BREAKFUNCTION, as the user interface.
BREAKF and TRACEF together are called the Break Package.
BREAKF modifies the definition of a function "fn", so that if a break
condition (defined by the user) is satisfied, the evaluation is halted
temporarily on a call to "fn". The user can then interrogate the state
of the world, perform any computations, and continue or return from the
call. For a more complete description of BREAKF, see the subsection
"Break Package."
TRACEF modifies a definition of a function "fn" so that whenever "fn"
is called, its arguments (or some other values specified by the user)
are printed. When the value of "fn" is computed it is printed. For a
more complete description of TRACEF, see the subsection "Break Package."
BREAKFUNCTION _____________
BREAKF and TRACEF redefine functions in terms of BREAKFUNCTION. When
an error occurs control is passed to BREAKFUNCTION.
Whenever LISP types a message of the form:
n: DEPTH= m DEBUGGING fn
the user is "talking to" BREAKFUNCTION, and is said to be in a break.
"n" is the number of active calls to BREAKFUNCTION, "m" is the number of
function calls on the pushdown stack, and "fn" is the function last
called before BREAKFUNCTION (normally the function for which BREAKF was
issued). BREAKFUNCTION allows the user to interrogate the state of the
LISP Debugging Facilities 101
Previous Page Next Page