Fork me on GitHub
#cursive
<
2022-09-21
>
genekim16:09:48

A public service announcement, on the value of (sometimes? always?) using REPLs with classpath set with deps.edn, instead of IntelliJ project classpath. I spent hours while trying to get the Google Secret Manager library working, thinking I was struggling with conflicting google library dependencies, which I’ve heard people complain about. I must have made 20+ changes to dependencies, to no avail. Inspired (and desperate for answers) by the 2019 message, I tried running it in a clj repl session, and to my utter shock, it worked. (So, I guess it was indeed a conflicting google library dependency, but nothing to do with deps.edn ! 😂 https://clojurians.slack.com/archives/C02BJCKN0R4/p1663777642867749

imre16:09:23

have you figured out how the rogue dep got onto the IJ classpath?

genekim16:09:42

Alas, no — I was just happy to get it working. I barely know what a classpath is. 🙂 I was thinking it may have been clojurescript and the google-closure-compiler, but ruled that out. Maybe? I may revisit it tonight — will keep you posted, as I suspect it’s worth understanding more fully.

imre16:09:55

When you start up a cursive nrepl (if it's nrepl you're talking about), the second line in it, (the one that starts with something like /Users/myuser/... is clickable and contains the classpath

imre16:09:51

at least for me, this could depend on your OS, how you have java installed etc

caleb.macdonaldblack16:09:02

Anyway to disable tag literals for maps with keywords namespace map syntax? Instead of this:

{:foo/bar 1
 :foo/bar2 2}
=> #:foo{:bar 1, :bar2 2}
I could get this:
=> {:foo/bar 1, :foo/bar2 2}
Also no commas would be nice too

caleb.macdonaldblack16:09:05

It’s a clojure setting

(set! *print-namespace-maps* false)

Alex Miller (Clojure team)16:09:31

Just for reference, this is “namespace map syntax” and not tagged literals (although they look similar at a glance)

caleb.macdonaldblack17:09:55

Ah no worries. Thanks for the correction. It’s clear to me now they’re completely different. > Tagged literals are Clojure’s implementation of edn tagged elements.

dpsutton18:09:06

the commas come from the printer (they aren’t a part of the datastructure of coure). I haven’t seen any pretty printers that omit them. I think they are pretty hard coded in there. I have often wanted to get rid of them

Noah Bogart20:09:28

zprint can exclude them, but that's a much more opinionated and complicated tool

Dustin Getz19:09:19

The new auto-require on typing of recognized namespace is excellent, I just noticed it

cfleming06:09:58

Which one do you mean? I don’t think anything new has been added there in a while.