Debugging in Clojure
blog.davemartin.me
Debugging in Clojure
1–10 of 28 posts
Re: Debugging in Clojure
#2Otherwise great article, I hadn't heard about scope-capture.
Re: Debugging in Clojure
#3Re: Debugging in Clojure
#4https://docs.cider.mx/cider/debugging/debugger.html#using-th...
Re: Debugging in Clojure
#5For those of us using CIDER don't forget #break / #dbg! https://docs.cider.mx/cider/debugging/debugger.html#using-th...
#dbg(defn get-first [input] (nth input 0))
(get-first [4 2 3]) ;; 4
(get-first 5) ;; gives me a stack trace and no program state
So it's nice to have, but I think this is maybe only useful if you're working through someone else's code?Re: Debugging in Clojure
#6What would be nice is a GDB-like state along with stacktraces when you get a crash. Clojure stack traces are notoriously long and spooky. You learn to read the tea leaves, but even if you manage to identify where the crash happened and what triggered it (not always obvious..) you then need to pepper things with `println` to figure out the last local state before the whole thing blew up.
It looks like once you've found the problem area you can use `sc.api/spy` ..? It'd at least solve half the problem
Re: Debugging in Clojure
#7https://www.reddit.com/r/Clojure/comments/oe40af/debugging_i...