This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-21
Channels
- # announcements (13)
- # babashka (63)
- # babashka-sci-dev (64)
- # beginners (37)
- # biff (1)
- # calva (10)
- # cider (7)
- # clj-kondo (15)
- # cljsrn (6)
- # clojure (26)
- # clojure-dev (10)
- # clojure-europe (34)
- # clojure-france (9)
- # clojure-nl (2)
- # clojure-norway (36)
- # clojure-uk (5)
- # clojurescript (142)
- # community-development (1)
- # conjure (3)
- # datalevin (5)
- # datalog (2)
- # datomic (5)
- # events (11)
- # fulcro (40)
- # gratitude (9)
- # guix (32)
- # honeysql (10)
- # jobs (2)
- # lsp (32)
- # malli (15)
- # meander (5)
- # membrane (43)
- # missionary (3)
- # nextjournal (9)
- # off-topic (38)
- # pathom (3)
- # polylith (30)
- # portal (78)
- # programming-beginners (4)
- # quil (6)
- # re-frame (20)
- # reagent (21)
- # remote-jobs (2)
- # shadow-cljs (7)
- # tools-deps (6)
- # xtdb (23)
What's the recommended way to set up an initial namespace for a clojure-cli
repl? https://docs.cider.mx/cider/repl/configuration.html#customizing-the-initial-repl-namespace only mentions Leiningen's builtin setting. The only option that probably could be made to work that I could find so far is customizing cider-repl-init-code
via an eval
form in .dir-locals.el
since one needs to add to the default rather than replace it. Is there a cleaner alternative?
I recommend using the user
namespace to set the namespace, or require/start other development tools
I create a dev/user.clj
file and add the dev path via an alias, e.g. :env/dev
In the user.clj file, require the namespace and then use (in-ns 'namespace.name)
to switch to the namespace
This works fine for a terminal UI to the REPL, but I don't remember testing it with the Cider repl buffer (I use the source code buffers to evaluate, so setting the namespace is redundant, as Cider manages that for me)
Here are some examples of how I use the dev/user.clj
file
https://practical.li/clojure/clojure-cli/projects/configure-repl-startup.html

Thanks! I should mention that this is in the context of a monorepo with a common user.clj
for all subprojects but each subproject has its own dev helpers namespace (e.g. with some convenience functions for a "reloaded" workflow) which is probably a bit of a special situation. I solved this now by passing in a jvm property via an alias which determines the dev namespace to load when said common user namespace is loaded. However, invoking in-ns
this way doesn't affect CIDER's current REPL namespace. But that's alright. Just wanted to be sure that I'm not missing anything obvious!
Yes, I could change the namespace but couldnt get the REPL to stick with changed namespace, its always reverting back to user at some point before the REPL prompt displays.
Yes, it was interesting to revisit this issue. I do have a way to set it the namespace for a terminal repl (Rebel Readline), but its a bit of a hack. I made some notes in this issue in case I have time for more investigation https://github.com/practicalli/clojure/issues/409
That's really not a cider property there. I think it's common to make a user.clj file with a function that requires and then in-ns whichever namespace you need
I recommend using the user
namespace to set the namespace, or require/start other development tools
I create a dev/user.clj
file and add the dev path via an alias, e.g. :env/dev
In the user.clj file, require the namespace and then use (in-ns 'namespace.name)
to switch to the namespace
This works fine for a terminal UI to the REPL, but I don't remember testing it with the Cider repl buffer (I use the source code buffers to evaluate, so setting the namespace is redundant, as Cider manages that for me)
Here are some examples of how I use the dev/user.clj
file
https://practical.li/clojure/clojure-cli/projects/configure-repl-startup.html
