If I have this alias in my deps edn: :setmain {:ns-default foo.foo}, when I run clj -A:setmain, why does it start a repl in the user namespace instead of foo.foo?
:ns-default tells -X and -T to lookup unqualified symbols passed as arguments in the given namespace
I see, thanks
Do you know if there a way to set the default namespace when you are starting a REPL?
there is none
ah, ok
you can pass expressions to be pre-evaluted
% clj -M -e '(ns foo)' -r
foo=>
which I believe in tools.deps would be maybe a main args, no idea how any of that would be quoted/escapedNice, that approach works. I'll try to see if there is a way to put it in an alias.
You can put that in :main-opts
If it's an existing ns you want to load and switch to at startup, make sure you require it and then in-ns it!
Rather than try to set the namespace when starting the repl, a common practice is to use a custom user namespace to load and run code
https://practical.li/clojure/clojure-cli/repl-startup/