You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I deliberately make a mistake in the REPL, e.g. (defn a 1), I don't see expound's output, only the usual clojure.spec output.
What seems to work
Doing (set! s/*explain-out* expound/printer) interactively after I start/connect to the REPL -- then syntax errors are caught and printed by expound. I'm not sure how this would work for spec errors deep inside the code in other threads.
@orestis thanks for reporting this! This is a common source of confusion, so I should either improve the documentation or add a function that sets up everything correctly.
Can you provide more detail about how you want to use expound in other threads? In my quick test, set! worked fine, but I suspect your use case is different. I’d like to make sure my instructions cover your case.
I'm not sure if this is actually an issue with expound, or if I'm misunderstanding how it's supposed to work.
Desired behaviour
All spec errors are handled by expound's printer, no matter if they are made on the REPL during development or at any other place.
Steps I thought I needed to do
Add the following code to the namespace that contains my
-main
function, which is also the namespace that CIDER loads by default.(alter-var-root #'s/*explain-out* (constantly expound/printer))
What actually happens
When I deliberately make a mistake in the REPL, e.g.
(defn a 1)
, I don't see expound's output, only the usual clojure.spec output.What seems to work
Doing
(set! s/*explain-out* expound/printer)
interactively after I start/connect to the REPL -- then syntax errors are caught and printed by expound. I'm not sure how this would work for spec errors deep inside the code in other threads.How does it look like
Project.clj
The text was updated successfully, but these errors were encountered: