Hacker News new | ask | show | jobs
by NightMKoder 1808 days ago
This isn’t mentioned in the article, but I found debug-repl [1] to be amazing when debugging in the repl. For simple prints, wrapping expressions in (doto prn) has always been enough for me without custom readers. But when debugging something super odd, just stopping somewhere and evaluating a bunch of code (with locals in scope) to understand what you’re dealing with is invaluable. Clojure’s immutability makes it especially nice since you can just rerun (most) expressions to “see what happens.”

[1] https://github.com/gfredericks/debug-repl

1 comments

I've heard good things about debug-repl, although I haven't used it myself. From what I understand, it fills a similar niche to scope-capture. However you do it, being able to capture the state at a certain point in the code is essential.