Hi Jim,
The default behavior of the REPL is to show only the
exception to avoid too much clutter on the screen.
The special variable *e stores the last exception which
can be used to see the stack trace. So one way to do
this would be:
user=> (defn foo [] (/ 1 0))
#=(var user/foo)
user=> (foo)
java.lang.ArithmeticException: Divide by zero (NO_SOURCE_FILE:0)
user=> *e
#=(clojure.lang.Compiler$CompilerException.
"java.lang.ArithmeticException: Divide by zero (NO_SOURCE_FILE:0)")
user=> (.printStackTrace *e)
java.lang.ArithmeticException: Divide by zero (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:4117)
at clojure.lang.Repl.main(Repl.java:87)
Caused by: java.lang.ArithmeticException: Divide by zero
at clojure.lang.Numbers.divide(Numbers.java:142)
at user.foo__2478.invoke(Unknown Source)
at user.eval__2481.invoke(Unknown Source)
at clojure.lang.Compiler.eval(Compiler.java:4106)
... 1 more
nil
user=>
Parth