DEV Community

CoffeeBeagle
CoffeeBeagle

Posted on

1

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more