This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-24
Channels
- # announcements (7)
- # babashka (5)
- # babashka-sci-dev (20)
- # beginners (125)
- # biff (98)
- # catalyst (1)
- # clerk (37)
- # clj-kondo (6)
- # clojure (49)
- # clojure-dev (18)
- # clojure-europe (6)
- # clojure-uk (2)
- # data-science (17)
- # deps-new (20)
- # emacs (11)
- # helix (5)
- # hyperfiddle (34)
- # malli (3)
- # missionary (4)
- # reitit (4)
- # sci (15)
- # solo-full-stack (7)
- # sql (5)
- # testing (2)
I’m going through https://youtu.be/gIoadGfm5T8?si=5poCMJBFPKaPO8KH&t=697 (thank you again for making it). I’m trying to use the clojure -A
functionality instead of the clojure -X
in the video. Is that appropriate? Also, is this seemingly non-idempotent behavior expected?
% clojure -Ttools install-latest :lib io.github.seahcorfield/deps-new :as new
Cloning:
Downloading: io/github/seahcorfield/deps-new/maven-metadata.xml from datomic-cloud
new: Did not find versions for io.github.seahcorfield/deps-new
% clojure -Ttools install-latest :lib io.github.seancorfield/deps-new :as new
new: Installed io.github.seancorfield/deps-new v0.5.2 {:git/tag "v0.5.2", :git/sha "253f32a"}
I’m pretty sure I ran the same command.My guess is a newer version of the Clojure CLI tool is required, to support the install-latest version
• clojure -X
means eXecute a Clojure function (and pass the EDN arguments from the command-line as a single hash map)
• clojure -M
means run the Main function (`clojure.main`) and pass all the command-line arguments as a sequence of strings
• clojure -T
means use a Tool: which means without the context of the project -- either a named tool -Tname
that was installed via -Ttools install
or an alias-based tools -T:my-tool
where :my-tool
is in your :aliases
(either in your project deps.edn
or your user deps.edn
)
• clojure -A
is intended to mean "start a REPL" (that it still runs clojure.main
right now is a legacy artifact and will go away at some point).
Does that help @U05ML354JLU?
So -A
and -M
are "similar" right now (both go through clojure.main
), and -X
and -T
are "similar" (both invoke a Clojure function with a single hash map as its argument).
That helps, Sean. Thank you. I’m not sure why it took me so long to run clojure --help
. Your words put meat on the bones from that output.
Thanks again for the video. The REPL really is a different world.
But it's how I work all the time: jacked-in to a REPL in the background, eval'ing code continuously as I go along, including running tests from the editor via the REPL. Even with our 200 subproject, 140k line codebase at work 🙂
(I often work for quite a while without even saving code, since I can eval a top-level form without saving the file!)
Yeah, I have a Joyride script that starts an ssh tunnel to QA or production and connects to an nREPL server running there (plus a Portal server), so I can have the same edit/eval experience against QA or production as I have locally (mostly -- I don't have CIDER middleware enabled on QA/production, just a bare nREPL).
(Portal is a fairly "heavy" dependency so I only have that in one app on QA/production)
13 years of Clojure and I'm still learning new/better stuff all the time. It's a process 🙂
You can ask via DM if you want, or in #C05SVE3P116 or #C053AK3F9 depending on how wide an audition you want for the question (and the answers).