This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-29
Channels
- # announcements (44)
- # architecture (12)
- # babashka (45)
- # beginners (56)
- # calva (16)
- # cider (34)
- # clj-kondo (6)
- # clojure (47)
- # clojure-austin (2)
- # clojure-brasil (3)
- # clojure-europe (39)
- # clojure-germany (2)
- # clojure-nl (1)
- # clojure-norway (39)
- # clojurescript (7)
- # cursive (1)
- # datahike (2)
- # datomic (28)
- # emacs (8)
- # gratitude (3)
- # humbleui (4)
- # hyperfiddle (45)
- # kaocha (1)
- # lsp (94)
- # nbb (2)
- # off-topic (29)
- # practicalli (8)
- # releases (2)
- # shadow-cljs (6)
- # squint (17)
- # tools-deps (12)
- # vim (11)
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
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/escaped🙏 2
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!
👍 2
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/
🙏 2