4 ms·
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?
by billfruit 5y 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?
- DaveWM 5y agoCursive's debugger doesn't, but as one of the other posters mentioned there's a library called debug-repl which gives you this: https://github.com/gfredericks/debug-repl https://github.com/gfredericks/debug-repl. However, as I mentioned in the article, I've found it's usually better to use scope-capture than a debugger that pauses execution. The main reason is that I mainly work with Kafka Streams atm, and when the debugger pauses one thread other threads start timing out and throwing exceptions.
- billfruit 5y agoThat seems to give a repl at a breakpoint, I was asking about getting a repl at a point of exception. That is what elisp gives.
- DaveWM 5y agoAh sorry, I don't know of a way of doing that in Clojure. What I usually do is figure out where the exception was thrown, wrap that form in `sc.api/spy`, and then somehow re-execute it.
- slifin 5y agoCursive's debugger does let you restart the execution? It's a normal step debugger, and you can run new expressions in context are we talking about lisp restarts?
- geokon 5y agoI asked something similar on the Cider Github and it sounds like it's not possible to get ELisp level debugging: https://github.com/clojure-emacs/cider/discussions/2999 https://github.com/clojure-emacs/cider/discussions/2999 If anything Clojure needs this more than ELisp b/c of the crazy error stacks and b/c of how the laziness makes things blow up in all sorts of weird places