nrepl 2023-09-01

people who use Clojure CLI + nrepl, do you always see user as the init ns? If not, how do you change it? It seems that Lein's way of setting it is a bit contrived. But might be the only one possible with nrepl. It appears to be to set a --handler (https://github.com/nrepl/nrepl/blob/5839006c5f522fd5e6cf2adbcc5b59e4bd0677dd/doc/modules/ROOT/pages/usage/server.adoc?plain=1#L97) that executes:

(swap! session assoc (var *ns*) my-ns)
...which is hard to do dynamically. It sounds to me like https://github.com/nrepl/nrepl/blob/5839006c5f522fd5e6cf2adbcc5b59e4bd0677dd/src/clojure/nrepl/cmdline.clj could take an "init ns" CLI option?

👀 1

What is your use case? Why do you need separate user namespaces?

What I tend to do is to keep 'user very very lightweight, without any requires in ns form, and most of the time with only one function to jump to a namespace with development functions. Not only it allows to differentiate REPL init, but also makes really quick to start the REPL

👍 1

People in the Lein world are used to set an arbitrary :init-ns . As a tooling author, I'd need to support that

👍 1