On Fri 27 Dec 2013 at 11:23:22PM -0500, Lee Spector wrote:
>
> On Dec 27, 2013, at 11:18 PM, guns wrote:
> >
> > 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.
>
>
> When and where do you call this?

I call this inside of the closest function that raised the exception.

> I can live without the local REPL (although I'll always miss it), but
> what I want is to see the locals when I hit an exception somewhere
> that I didn't expect one. I'd like every exception to dump locals, all
> up the stack if possible. Can this, or something like it, do that?

Like you mentioned, I've heard nrepl-ritz does this in emacs, and David
Greenberg has something like this set up for vim:

https://github.com/dgrnbrg/vim-redl

I don't use this myself, however. The dump-locals macro is essentially a
fancy way to do printf debugging, which I have found sufficient.

    guns

Attachment: pgpIhJDs6U1gr.pgp
Description: PGP signature

Reply via email to