TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Debugging in Clojure

124 pointsby DaveWMalmost 4 years ago

10 comments

fulafelalmost 4 years ago
The first example about spyscope potentially confuses the reader a bit by using it in context of println debugging. The point of it is you can stick it in front of any form. For a better example, see <a href="https:&#x2F;&#x2F;github.com&#x2F;dgrnbrg&#x2F;spyscope#spyp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dgrnbrg&#x2F;spyscope#spyp</a><p>Otherwise great article, I hadn&#x27;t heard about scope-capture.
评论 #27759265 未加载
zurnalmost 4 years ago
For those of us using CIDER don&#x27;t forget #break &#x2F; #dbg!<p><a href="https:&#x2F;&#x2F;docs.cider.mx&#x2F;cider&#x2F;debugging&#x2F;debugger.html#using-the-debugger" rel="nofollow">https:&#x2F;&#x2F;docs.cider.mx&#x2F;cider&#x2F;debugging&#x2F;debugger.html#using-th...</a>
评论 #27758121 未加载
brokenkebabalmost 4 years ago
Elephant in the room: Sayid. It&#x27;s made for Emacs, and it&#x27;s so powerful, you may want to switch to Emacs just because of it.
评论 #27759122 未加载
NightMKoderalmost 4 years 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.”<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;gfredericks&#x2F;debug-repl" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gfredericks&#x2F;debug-repl</a>
评论 #27759243 未加载
slifinalmost 4 years ago
Some additional conversation on this blog post here:<p><a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;Clojure&#x2F;comments&#x2F;oe40af&#x2F;debugging_in_clojure_dave_martins_blog&#x2F;?sort=confidence" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;Clojure&#x2F;comments&#x2F;oe40af&#x2F;debugging_i...</a>
phoe-krkalmost 4 years ago
For people who want to get a more CL-like debugging setup on Clojure, there is a CL-style condition system available as a library.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;IGJoshua&#x2F;farolero&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;IGJoshua&#x2F;farolero&#x2F;</a>
评论 #27759306 未加载
geokonalmost 4 years ago
Could `scope-capture` be used to capture state before a crash?<p>What 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.<p>It looks like once you&#x27;ve found the problem area you can use `sc.api&#x2F;spy` ..? It&#x27;d at least solve half the problem
评论 #27762349 未加载
评论 #27759206 未加载
tankfeederalmost 4 years ago
Debugging in PicoLisp <a href="https:&#x2F;&#x2F;envs.net&#x2F;~mpech&#x2F;tut.html#dbg" rel="nofollow">https:&#x2F;&#x2F;envs.net&#x2F;~mpech&#x2F;tut.html#dbg</a>
billfruitalmost 4 years ago
Does the Clojure debugger give a live Repl, where one can examine values of locals and restart execution if required, likes the elisp debugger in Emacs?
评论 #27759292 未加载
评论 #27759593 未加载
wedesoftalmost 4 years ago
You can just use &quot;(clojure.main&#x2F;repl)&quot; to start a repl with environment in your code.