CSC242: LISP Debugging Tips




[ Updated: January 11, 2002]

Here are some functions that might help:

:zoom

When your function has an error, type :zoom at the prompt and it will show the last few function calls. This is useful in narrowing down where the bugs are.

(trace )
This takes a function name as an argument and every time you run it, shows what recursion depth it is called at, what its inputs are and what its output is. So if I wanted to trace "add-position-recur" I would type:

(trace add-position-recur)

To get rid of trace, just do (untrace). You can trace as many functions as you like. Be careful tracing lisp primitives though.





[ csc242 Home ]