Debugging Hints
Apparently some of you havent discovered LISP's debugging secrets! Have you tried (step ...) and (trace ...) ?? ->(describe 'step) STEP - external symbol in LISP package ----------------------------------------------------------------------------- STEP [Macro] Syntax: (step form) Evaluates FORM in the single-step mode and returns the value. ----------------------------------------------------------------------------- ->(describe 'trace) TRACE - external symbol in LISP package ----------------------------------------------------------------------------- TRACE [Macro] Syntax: (trace {function-name}*) Traces the specified functions. With no FUNCTION-NAMEs, returns a list of functions currently being traced. ----------------------------------------------------------------------------- Note (break ...) too: ----------------------------------------------------------------------------- BREAK [Function] Args: (&optional (format-string nil) &rest args) Enters a break loop. If FORMAT-STRING is non-NIL, formats FORMAT-STRING and ARGS to *ERROR-OUTPUT* before entering a break loop. Typing :HELP at the break loop will list the break-loop commands. ----------------------------------------------------------------------------- Insert that where you want to know what is going on. You can look at vbl bindings and run fns. ========== The initial debugging problems come from parens not being balanced. Get those sorted out first! The interactive nature of LISP makes debugging much easier as you can isolate each fn and run it separately much more easily. Do that. Then test halting situations. ========== Note that if something is wrong the break loop is entered. e.g., >(defun tst (a b) (+ a b) ) TST >(tst 'a 1) >>Error: A is not of type NUMBER. + (IHS[9]) Arg 0: A Arg 1: 1 Restart options (Type :C): :Q, 0: Lisp Top Level Type :H for a list of debugger commands. ->:v TST (IHS[8]) Arg 0 (A): A Arg 1 (B): 1 Local variables: A = A B = 1 Blocks: TST Special variable bindings: BDS[10]: CONDITIONS::*RESTART-CLUSTERS* = NIL FRS[4]: (BLOCK TST ***) ---> IHS[8],VS[43],BDS[10] ->B 1 ->(+ 2 1) 3 ->:q Back to Lisp Top Level... > Note that :h will give information about other commands to try. ______________________________________________________________________________ Wed Nov 4 15:24:32 EST 1998