Fork me on GitHub
#clojure-dev
<
2018-11-20
>
athos03:11:00

;; Clojure 1.10.0-beta6
(defn f [] (/ 1 0))
(f)
;; Execution error (ArithmeticException) at user$f/invokeStatic (REPL:1).
;; Divide by zero
Is this user$f/invokeStatic intentional? I want it like user/f, as clojure.spec.test.alpha does here https://github.com/clojure/spec.alpha/blob/2329bb2d869ce59d92a401082587cc82edfce95a/src/main/clojure/clojure/spec/test/alpha.clj#L88-L93

alexmiller03:11:37

In execution phase errors, you don’t have the compiler’s context, you’re just working from a java stack trace

alexmiller03:11:43

But we could probably do something like that

alexmiller03:11:07

If you wanted to file a jira, that would be helpful

athos04:11:01

Sure, I will!

Marc O'Morain13:11:47

Ideally the current namespace could be taken into account. If the current namespace (`user`) is the same as the namespace of the stacktrace element that is being called, there is no need to print it. So the error could read:

Execution error (ArithmeticException) at f (REPL:1).

alexmiller13:11:26

nah, I think that’s too special

athos22:11:28

@alexmiller Thanks! You’re an amazing fast worker! 😆