This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-22
Channels
- # aleph (20)
- # announcements (4)
- # babashka (72)
- # beginners (64)
- # biff (5)
- # calva (146)
- # cider (5)
- # clj-kondo (18)
- # clj-together (3)
- # cljsrn (28)
- # clojure (95)
- # clojure-berlin (2)
- # clojure-europe (34)
- # clojure-nl (2)
- # clojure-norway (3)
- # clojure-uk (3)
- # community-development (7)
- # conjure (1)
- # cursive (2)
- # data-science (12)
- # datalevin (13)
- # datomic (17)
- # events (2)
- # figwheel-main (5)
- # fulcro (7)
- # helix (8)
- # hyperfiddle (52)
- # jobs (1)
- # malli (14)
- # off-topic (32)
- # polylith (24)
- # remote-jobs (7)
- # scittle (3)
- # shadow-cljs (14)
- # slack-help (3)
- # spacemacs (3)
- # vim (2)
- # xtdb (6)
I'd like to run eval a form in a new repl right after it has started, is there a way to configure cider-jack-in to do that? Specifically (set! *print-namespace-maps* false)
.
leveraging user.clj
might suffice
Sometimes alter-var-root
is more effective for these (even if altering clojure.core is yucky), dyn vars are funny, especially when considering a complex thing like nREPL
user.clj
gave me some guff. Using (set! *print-namespace-maps* false)
blows it up:
error in process sentinel: Could not start nREPL server: Exception in thread "main" Syntax error macroexpanding at (user.clj:37:1).
at clojure.lang.Compiler.load(Compiler.java:7665)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:368)
at clojure.lang.RT.maybeLoadResourceScript(RT.java:364)
at clojure.lang.RT.doInit(RT.java:486)
at clojure.lang.RT.init(RT.java:467)
at clojure.main.main(main.java:38)
Caused by: java.lang.IllegalStateException: Can't change/establish root binding of: *print-namespace-maps* with set
at clojure.lang.Var.set(Var.java:226)
at user$eval73697.invokeStatic(user.clj:38)
at user$eval73697.invoke(user.clj:38)
at clojure.lang.Compiler.eval(Compiler.java:7194)
at clojure.lang.Compiler.load(Compiler.java:7653)
... 6 more
And using (alter-var-root #'*print-namespace-maps* (constantly false))
didn't appear to work - it's still set to true
.
In any case, I'd like to not force my preference on my coworkers if possible.Not sure if there’s a way to do this on the CIDER side. I solved the same problem using :main-opts
in my ~/.clojure/deps.edn
:
{
:aliases {:cider {:main-opts ["-e" "(set! *print-length* 50)"
"-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}
}
I don’t use cider-jack-in
(I start Clojure separately and then cider-connect
) but I think you can configure options to pass with the cider-clojure-cli-global-options
customization (assuming you use the Clojure CLI).