Fork me on GitHub
#deps-new
<
2023-09-24
>
Chip19:09:44

I’m going through https://youtu.be/gIoadGfm5T8?si=5poCMJBFPKaPO8KH&amp;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.

practicalli-johnny19:09:00

My guess is a newer version of the Clojure CLI tool is required, to support the install-latest version

Chip19:09:46

Ah. That makes sense. Thank you.

seancorfield20:09:26

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?

seancorfield20:09:32

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).

Chip20:09:14

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.

seancorfield20:09:00

If you have any Qs about anything in that video, hit me up any time.

gratitude-thank-you 1
seancorfield20:09:02

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 🙂

Chip20:09:49

That you jack-in to production systems is mind blowing. I think Biff is setup that way.

seancorfield20:09:52

(I often work for quite a while without even saving code, since I can eval a top-level form without saving the file!)

Chip20:09:42

Watching you guys is like watching trapeze artists

seancorfield20:09:14

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).

seancorfield20:09:52

(Portal is a fairly "heavy" dependency so I only have that in one app on QA/production)

Chip20:09:48

🎼 He floats through the air with the greatest of ease… 🎵

Chip20:09:15

Thank you for knowing your stuff. It helps those of us who don’t.

seancorfield20:09:38

13 years of Clojure and I'm still learning new/better stuff all the time. It's a process 🙂

Chip20:09:39

Amen. I’m seaside with a teaspoon.

Chip22:09:21

Ask more about the video here or in #C053AK3F9?

seancorfield22:09:48

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).

Chip22:09:30

Thanks. I just found that #C053AK3F9 thread that seemed to make sense.