
3.2 Entering and exiting the Debugger
error,cerror,break, orinvoke-debugger. Use these constructs when a function is returning the wrong value and you want to stop the function at certain points to examine the current state of Lisp and the values of local variables.add-one is called with an argument that is not a number:
> (defun add-one (x)
(unless (numberp x)
(error "Argument must be a number."))
(+ x 1))
ADD-ONE
> (add-one 'a)
>>Error: Argument must be a number.
ADD-ONE:
Original code: (NAMED-LAMBDA ADD-ONE (X)
(BLOCK ADD-ONE (UNLESS # #) (+ X 1)))
Required arg 0 (X): A
:A 0: Abort to Lisp Top Level
->

Generated with Harlequin WebMaker