This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-14
Channels
- # aleph (3)
- # beginners (25)
- # cider (12)
- # clojure (42)
- # clojure-canada (3)
- # clojure-nl (1)
- # clojure-russia (2)
- # clojure-spec (13)
- # clojure-uk (24)
- # clojurescript (23)
- # cloverage (1)
- # datomic (7)
- # figwheel-main (3)
- # jobs-discuss (14)
- # onyx (48)
- # parinfer (3)
- # re-frame (20)
- # reitit (28)
- # shadow-cljs (3)
- # testing (1)
- # vim (37)
Hm I thought this would work:
(alter-var-root #'s/*explain-out* (constantly exp/printer))
Here’s a gist that shows why alter-var-root doesn’t work as you might expect in this context https://gist.github.com/bhb/d82fcf0f80f555c28afa8db320be16c8
And here’s a different gist with an example of how I’d recommend setting up expound for instrumentation (if that’s what you are looking to do) https://gist.github.com/bhb/649c46ac6dfa290fa6a62bb96fb66f62
@U66G3SGP5 Let me know if you encounter any problems with the above code
I tried set!
before, but it's been my understanding that it only sets var value for current thread
Hm, I’m not sure what happens in threads started within the REPL - I can check later. You might have to call ‘set!’ in each thread. But in any case, alter-var-root! won’t work in the REPL context since the var is bound by Clojure before your code is run, so I think ‘set!’ is the only solution.
A quick workaround for this is to try (alter-var-root #'s/*explain-out* (constantly exp/printer))
in your user.clj
. Clojure runtime should automatically load user.clj
(if it exists) before launching the REPL.
@U66G3SGP5 Are the threads being created within the REPL context? If so, it looks like set!
will apply. See this gist. https://gist.github.com/bhb/910f718e2da57793bc0f5817f006f28a
If threads are being created outside the REPL, then yes, I would try what @U0508956F suggested above.
@U7PBP4UVA Did you end up getting expound to work with multiple threads?
to make all my stuff print spec errors with expound