Fork me on GitHub

Is there a way to get clojure to print more of the stack when the REPL fails to startup? I'm getting "... 38 more" just before the interesting bit! Can I print out the whole thing somehow?


I've actually figured out my the problem now. As usual, as soon as I have up and asked about it I spotted it. But still would be useful/ interesting to know for future. 🙂


when a repl fails startup, that is almost always because your tools told the repl to pre-load a namespace that was broken


if you still have a repl prompt after the error you can use (require 'my.ns :reload-all) to get the error again, and *e will hold the detailed error object


you can then edit your code, and repeatedly require / reload the apropriate namespaces until everything loads correctly, without restarting the repl itself


as a last resort (eg. if you can't even get a repl prompt) you can start clojure.main , the -main in that ns gives you a very bare bones clojure repl that you can do your require / reload in until things are fixed (you might not even be able to use arrow keys to edit though...)

hiredman06:09:14 discusses the "... 38 more" kind of thing, which is feature of printStactrace, so other mechanisms of viewing the stacktrace won't have it. But the elided lines are only removed because they are dupes


Thanks @hiredman. That looks useful!!


Why is (first v) slower than (nth v 0) on vectors? Is it doing more dynamic type dispatching? Or does it have some redundant function calls?


Or is it just the conversion to seq that slows it down?

Alex Miller (Clojure team)23:09:40

first is a seq op so you have to get a seq view of the vector

clojure-spin 4

Makes sense, so its the cost of creating the seq object over the vector. Thanks