I like this: (defmacro dump-locals [] `(clojure.pprint/pprint ~(into {} (map (fn [l] [`'~l l]) (reverse (keys &env))))))
Slingshot also allows one to throw+ an object that is full of local information: https://github.com/scgilardi/slingshot And Michael Drogalis's library Dire recently adopted Slingshot for handling exceptions: https://github.com/MichaelDrogalis/dire On Friday, December 27, 2013 11:18:04 PM UTC-5, guns wrote: > > On Fri 27 Dec 2013 at 11:03:20PM -0500, Lee Spector wrote: > > > On Dec 27, 2013, at 10:53 PM, Alex Baranosky wrote: > > > > > I always hear people say that the errors are bad, but I just don't > > > see it. The stacktraces say exactly what went wrong and at what line > > > of the source. To me that's all I can hope for. > > I'll have to agree with Alex, I've never really had that much of a > problem with Clojure errors. A stacktrace is certainly better than > "Segmentation fault". > > > One can hope to see the values of locals, which for me would make a > > big difference. This is apparently possible (through some combination > > of nrepl-ritz and avoiding locals clearing, I think), but not at all > > easy. In other parts of the Lisp universe this has been standard for > > decades and, I think, central to common debugging practices. > > I personally use the following macro from my user.clj: > > (defmacro dump-locals [] > `(clojure.pprint/pprint > ~(into {} (map (fn [l] [`'~l l]) (reverse (keys &env)))))) > > It's not the automatic break-on-exception-and-start-local-repl of CL + > Emacs, but it's editor agnostic and usually does the trick. > > I find that my desires for a stepping debugger are mostly absent with > Clojure as data is immutable, and the reference types may be monitored > with add-watch. > > guns > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.