Fork me on GitHub

If anyone is still using Maven for building/testing projects with Clojure, could you have a look over and see if it is still valid? @alexott was the original author (over a decade ago) but I'm not sure he's still active in the community? Feedback in 馃У please...

Alex Miller (Clojure team)01:02:53

might want to update the clojure-maven-plugin version there to something recent

Alex Miller (Clojure team)01:02:49

the 1.3.10 version mentioned is 11 years old :)

Alex Miller (Clojure team)01:02:27

I don't see anything obviously wrong there


And not at all confusing that when I search for clojure-maven-plugin this repo comes up first hen this is the "real" one -- so 1.8.4 is the current version (despite the project readme stating 1.8.3?).


Thanks for the 馃憖 on that @U064X3EF3!


Neighbor is learning java and had a question on underscores in numbers. I'd never seen, heard or come across this.,which%20can%20improve%20the%20readability%20of%20your%20code. so out of curiousity I tried the following in the repl and it didn't work

user=> (+ 0 3.14_15F)
Syntax error reading source at (REPL:1:14).
Invalid number: 3.14_15F
1. Why does clojure not support this? 2. If it did, what possible value can one have from doing this?


I can't find a reference, but I seem to recall reading that it was highly unlikely that this feature would be added to clojure. nvmd


Is it still true that making a local binding is more perfoemant than var lookups?


Local bindings have no indirection and the JVM can often inline them and only store them on the stack even.

馃憤 1

Hello! I'm trying to recursively walk a file path and put all paths that fulfill a predicate into a vector. In JS, I would just use a for-loop and mutate the array with the resulting files in place. In Clojure the equivalent of this would be using an atom. If I don't use an atom, I feel forced to split the tree walking and filtering. This seems like the cleaner solution but isn't it less performant? I need to occasionally walk over some 30,000 files.


I'm just thinking that I could probably also do the filtering in the same function without having to split up the logic.


I think it鈥檚 maybe better to fetch all the directory info by shell command and then filter and parse it in clojure/clojurescript, you鈥檇 do special thing with the best tool.


Hm, that's true. So, you would run find in a separate process and then parse the results in clojure? That seems a lot easier.


if you fetch the directory by sh/cmd in clojure, and you will get a result return by your shell command in format of clojure structure, the you can do anything in clojure


(sh "ls" "-aul")

馃憤 1

I used find because it recursively walks the file tree and I can add exclusions. Thanks!

馃憤 1

30,000 is not that many. I'd use java.nio.file.Files#walkFileTree or ...#walk.


A more idiomatic Clojure solution than atoms would be a plain loop. Each iteration begins with results-so-far and paths-still-to-do -- you kick off the very first iteration with [] and [root] respectively -- and each iteration in the loop peels off 1 path-still-to-do (if any; otherwise the job is done) and evaluates the condition and/or if it's a directory expands it into more paths-still-to-do, and recurs.


Are you finding file-seq too slow?


Ah, damn - I was somewhat certain there was a built-in function for it but completely blanked on its name.


I looked at file-seq but I couldn't find any documentation and it looks like I can't define exclusions or file patterns there. So, find on the shell still offers some conveniences. As soon as I'm done with the first iteration, I'll try different approaches, though, Maybe file-seq or walkFileTree are faster. find is not super fast right now but that might be because it has to access the disk several times.

Quentin Le Guennec16:02:27

Is there a tool that simplifies deps.edn management? Something like yarn that can be used to search dependencies, add dependencies to deps.edn, etc?

Quentin Le Guennec16:02:00

Perfect. Thank you.

Jes煤s G贸mez18:02:50

I have this information about a server I have running in the repl: #object[org.eclipse.jetty.server.Server 0x13d55cbd \"[email protected]{STARTED}[9.4.44.v20210927]\"] How can I use that information to stop it? I saw something similar using "reveal"[1], but I suppose that I can do the same with the Repl. And what about the other way, once I ran the server and supposing and didn't took note of the object: how to find the reference in the REPL? Is there a way to have a list of objects? [1]

Alex Miller (Clojure team)18:02:21

If you have a reference (via def or *1) you can call .stop on it

馃憤 1
Alex Miller (Clojure team)19:02:02

If you don鈥檛 have a reference, then you probably can鈥檛

馃憤 1
Jes煤s G贸mez19:02:48

Thank you very much!

Jes煤s G贸mez19:02:24

+1 to reveal to allow you to use the objects tracked by it.