DEV Community

CoffeeBeagle
CoffeeBeagle

Posted on

Debug with CommonLisp

1. Debug with print (It's easiest way)

It's easy way to make a function that output variable to standard output and return the variable.

(defun dbg (t)  (progn  (print t) t ))
Enter fullscreen mode Exit fullscreen mode

2. If you know of REPL

If you use 'break', you can see stack traces in REPL.

 (progn (break "hello debug dayo")
 ;; target code
 )
Enter fullscreen mode Exit fullscreen mode

3. It's my recommendation.

If you use 'step', you can see the variable when the target function is called. So it's best for me.
You need to surround a target function with progn, but you don't need it if you use 'step' function.

 (step (something))
Enter fullscreen mode Exit fullscreen mode

Top comments (0)