On Wed, Apr 1, 2009 at 9:10 AM, hughw <hwink...@gmail.com> wrote:
> I don't mind scrolling through the long stack crawl to discover where
> my error is. but I do wish the initial error report could somehow give
> me the information, rather thanrequiring the two step process (and
> switching windows when using the slime repl, although that is maybe
> not a clojure issue).

Also, in Slime, I've experimented with
(use 'clojure.contrib.stacktrace)
(use 'clojure.contrib.trace)
and then typing (e) to see a shorter stack trace, because I do get
frustrated by the long stack crawl.  Unfortunately, about half of the
time (e) doesn't show me any of the calls from *my code* that are part
of the error, so I have to go back to the long stack anyway.  I don't
know what algorithm those libs use to cull the stack trace, but for
me, they haven't been successful.  So I still find this aspect of
Clojure development unsatisfying.

Also, yesterday, I got an error that a keyword couldn't be converted
to a IFn.  (Turned out I called one of my functions with a vector of
keywords, rather than a vector of vectors of keywords, and inside the
function, it was bombing trying to apply the keyword (which was
supposed to be a vector) to something).  If the error had actually
showed me the keyword that couldn't be converted, I would have found
the problem in two seconds.  It ended up taking me a while to find the
problem, mostly because the stack trace was so dang confusing I
couldn't figure out what was calling the function with the wrong kind
of input.

Since static typing and compile-time checks are not present in
Clojure, I think it's extra important to make sure it is easy to
diagnose and fix these type mismatches.  In other dynamic languages
I've used, when I get a type mismatch, I usually find it very easy to
identify and fix the source of the problem.  A lot of it comes down to
the quality of the stack trace, as well as making sure the error
messages report as much as possible about the inputs/outputs that are
causing the problem.

--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to