beginners

Getting started with Clojure/ClojureScript? Welcome! Also try: https://ask.clojure.org. Check out resources at https://gist.github.com/yogthos/be323be0361c589570a6da4ccc85f58f.
West 2021-06-22T01:14:04.405900Z

Even on a rolling release?

dpsutton 2021-06-22T01:31:03.407200Z

Don’t know what that is. But if it uses the “package” version you cannot use the handy upgrade/downgrade feature of lein itself. And that’s what is occasionally useful

2021-06-22T01:37:45.407700Z

rolling release = a distro that just gets package updates continuously, not twice a year or whatever

2021-06-22T01:42:00.410800Z

The Leiningen upgrade/downgrade, if installed via Leiningen's own methods vs. some Linux distribution's package manager, seems to me to work regardless of that distribution's package update policies. There is no need to rely on, or wait for, anyone else to create a package for newer (or older) versions of Leiningen. I agree it isn't "just like every other package" you tend to install, but it is about as flexible as you can get, if you care which version you are running. I think I've typically got about 10 versions of Lein installed on my system at any given moment, which takes only a few KBytes of disk space the way it is packaged, since it is only a small shell script. Only the larger JAR files of the Lein versions I've actually used on the system get downloaded.

seancorfield 2021-06-22T04:50:01.411500Z

Sounds a bit like me with the Clojure CLI:

seanc@DESKTOP-30ICA76:~/oss$ ls -d /home/linuxbrew/.linuxbrew/Cellar/clojure*
/home/linuxbrew/.linuxbrew/Cellar/clojure             /home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.1.763
/home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.1.590  /home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.2.774
/home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.1.672  /home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.2.790
/home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.1.681  /home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.2.801
/home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.1.693  /home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.3.810
/home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.1.735  /home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.3.814
/home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.1.745  /home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.3.822
/home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.1.749  /home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.3.839
/home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.1.754
(and I think I have even more versions installed on my main system!)

seancorfield 2021-06-22T04:52:40.411600Z

(! 503)-> ls -d /usr/local/Cellar/clojure*
/usr/local/Cellar/clojure               /usr/local/Cellar/clojure@1.10.1.716    /usr/local/Cellar/clojure@1.10.2.801
/usr/local/Cellar/clojure@1.10.1.561    /usr/local/Cellar/clojure@1.10.1.723    /usr/local/Cellar/clojure@1.10.2.805
/usr/local/Cellar/clojure@1.10.1.590    /usr/local/Cellar/clojure@1.10.1.727    /usr/local/Cellar/clojure@1.10.3.810
/usr/local/Cellar/clojure@1.10.1.596    /usr/local/Cellar/clojure@1.10.1.735    /usr/local/Cellar/clojure@1.10.3.814
/usr/local/Cellar/clojure@1.10.1.619    /usr/local/Cellar/clojure@1.10.1.739    /usr/local/Cellar/clojure@1.10.3.822
/usr/local/Cellar/clojure@1.10.1.636    /usr/local/Cellar/clojure@1.10.1.745    /usr/local/Cellar/clojure@1.10.3.829
/usr/local/Cellar/clojure@1.10.1.641    /usr/local/Cellar/clojure@1.10.1.749    /usr/local/Cellar/clojure@1.10.3.833
/usr/local/Cellar/clojure@1.10.1.645    /usr/local/Cellar/clojure@1.10.1.754    /usr/local/Cellar/clojure@1.10.3.839
/usr/local/Cellar/clojure@1.10.1.672    /usr/local/Cellar/clojure@1.10.1.763    /usr/local/Cellar/clojure@1.10.3.849
/usr/local/Cellar/clojure@1.10.1.681    /usr/local/Cellar/clojure@1.10.2.774    /usr/local/Cellar/clojure@1.10.3.875
/usr/local/Cellar/clojure@1.10.1.693    /usr/local/Cellar/clojure@1.10.2.781    /usr/local/Cellar/clojure@1.10.3.882
/usr/local/Cellar/clojure@1.10.1.697    /usr/local/Cellar/clojure@1.10.2.790
/usr/local/Cellar/clojure@1.10.1.708    /usr/local/Cellar/clojure@1.10.2.796

2021-06-22T15:06:44.430600Z

What Java do people use to run CJ/CLJS projects? I was confused about the JVM implementations, but I understand that OpenJDK is actually the original thing from Sun/Oracle? What version is recommended? Always the newest one? I can see there are many openjdk-* packages in Ubuntu. (I installed openjdk-16-jre-headless for now.)

2021-06-22T15:17:47.432300Z

empty collections are truthy in clojure. does that mean folks are more likely to have a function return either a non-empty collection or a nil? as opposed to staying within a narrower type and always returning a collection (of a given type), whether empty or not

dpsutton 2021-06-22T15:20:07.433400Z

quite common to call seq on collections as return values to probe this. Often return a collection and let the caller care about whether it has any values in it

🙏 1
indy 2021-06-22T15:22:36.433900Z

not-empty is handy in such cases. Let the particular contexts handle it the way they want than deciding truthiness or falsiness beforehand

2021-06-22T15:22:49.434300Z

that seems consistent with what i perceive to be a general preference for avoiding nil in clojure

2021-06-22T15:23:09.434400Z

thanks! i greatly prefer not-empty over seq

alexmiller 2021-06-22T15:27:20.434600Z

OpenJDK is the open source GPL core, Oracle releases it's own derived from that + some extra stuff plugged in

alexmiller 2021-06-22T15:28:10.434800Z

most of the variants are built from the same OpenJDK core, except for the IBM j9 vm, which is a different impl

alexmiller 2021-06-22T15:29:13.435Z

there are both "LTS" (long term support) versions and intermediate releases without that. With Clojure, we recommend using an LTS version if you don't specifically need something from a newer version. The last 2 LTS versions were 8 and 11. 17 will be coming out this fall and will be the next LTS version.

dpsutton 2021-06-22T15:29:39.435700Z

i don't think there's a general preference for avoiding nil. but that gets close to style and personal preference

alexmiller 2021-06-22T15:29:41.435800Z

So we would currently recommend 11 (but other versions work too, including 16)

alexmiller 2021-06-22T15:30:18.436Z

I would actually recommend using the jdk (development kit) though, not the jre (runtime engine), as it includes tools you will find useful.

2021-06-22T15:53:50.436200Z

oh, that's interesting. what about place oriented programming and all that? {:a nil} vs {}?

2021-06-22T15:55:02.436400Z

i thought for sure the language convention was to omit a value instead of saying explicitly "this value is absent" via a nil

dpsutton 2021-06-22T15:55:56.436600Z

generally true to not put nil values in a map. I was just talking about shying away from nil as a value in general.

2021-06-22T16:00:36.437900Z

Thank you @alexmiller. So to be clear, when you say LTS, you are referring to LTS version of OpenJDK? Which in Ubuntu would then be openjdk-11-jdk-headless I reckon?

alexmiller 2021-06-22T16:01:14.438200Z

Yep

2021-06-22T16:01:31.438900Z

Perfect :thumbsup: Cheers!!!

alexmiller 2021-06-22T16:02:28.440300Z

All non-LTS versions should basically be considered dead (except the latest), so I would NOT use 9-10, 12-15

tws 2021-06-22T19:17:06.442800Z

in what namespace do y’all put your integration tests? I was just going to go with test/<package>/integrations/, but wondering if any tools look for something standard

tws 2021-06-23T13:22:18.453700Z

awesome point about kaocha ids, thanks!

seancorfield 2021-06-22T20:58:53.443200Z

I don’t there’s any particular convention for that, TBH.