This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-27
Channels
- # announcements (8)
- # babashka (2)
- # calva (21)
- # clojure (30)
- # clojure-europe (4)
- # conjure (1)
- # core-logic (5)
- # data-science (1)
- # emacs (10)
- # hyperfiddle (1)
- # introduce-yourself (1)
- # luminus (62)
- # meander (23)
- # nbb (26)
- # off-topic (9)
- # reitit (2)
- # spacemacs (2)
- # squint (65)
- # tools-build (4)
- # tools-deps (17)
- # xtdb (20)
Hello, I’m a bit confused. I’ve a ~/.clojure/deps.edn
with a few aliases. If I cd to ~/.clojure
and run clj -A:portal -Stree
it finds :portal
alias and prints all dependencies. However in all other directories clj
does not find :portal
alias and prints WARNING: Specified aliases are undeclared and are not being used: [:portal]
. What I’m missing here? Using latest clojure version 1.11.1.1155 on macos.
Ok, clojure cli lookups for $CLJ_CONFIG
first, then $XDG_CONFIG_HOME
and fallbacks to $HOME/.clojure
. Recently I defined XDG_CONFIG_HOME
for another tool to work. So that broke clojure’s search path. Fixed by defining $CLJ_CONFIG
I agree with Sean that .config/clojure is a more discoverable place I also moved all my Clojure dev tooling to XDG specification https://practical.li/blog/posts/adopt-FreeDesktop.org-XDG-standard-for-configuration-files/
In my -main
function I am using print
and was seeing the expected output in the terminal when running clj -M -m practice.core
but not when building and running the uberjar with java -jar ...
. In looking at the print
docs I figured I needed to add a call to flush
and sure enough that fixed it. I had read that using the clj -M -m
method of running a program is equivalent to using java -jar
so I'm curious if there are other small gotchas like this.
That's what I figured. Tbf, I think that conversation was more in the line of starting a backend server. Maybe they meant in that specific instance you could use either or.
You would need to share more of your code and uberjar to really say more
Eh, it's just my little practice repo. Nothing really going on there. More a curiosity than a problem. https://github.com/Chase-Lambert/clojure-practice/blob/main/src/practice/core.clj
when build the uberjar, are you setting practice.core as the Main-Class ?
Yep. The code works. I was just curious about the difference between clj -M -m ...
and java -jar ...
as the former worked without calling (flush)
and the latter did not. I am wondering what other differences there are because they are running the same function.
It's cool how readable the clojure source is. I imagined a ton of wild optimizations but even though some of this is over my head it seems quite approachable to me.
The repl is really just calls to read
eval
print
in a loop
. So not much magic