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
Ah. That makes sense. Thank you.
• 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 @two.stewards?
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.
If you have any Qs about anything in that video, hit me up any time.
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 🙂
That you jack-in to production systems is mind blowing. I think Biff is setup that way.
(I often work for quite a while without even saving code, since I can eval a top-level form without saving the file!)
Watching you guys is like watching trapeze artists
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)
🎼 He floats through the air with the greatest of ease… 🎵
Thank you for knowing your stuff. It helps those of us who don’t.
13 years of Clojure and I'm still learning new/better stuff all the time. It's a process 🙂
Amen. I’m seaside with a teaspoon.
Ask more about the video here or in #beginners?
You can ask via DM if you want, or in #solo-full-stack or #beginners depending on how wide an audition you want for the question (and the answers).
Thanks. I just found that #beginners thread that seemed to make sense.