clojure-europe

Ludger Solbach 2025-11-24T08:18:49.459669Z

morning

👋🏼 1
thomas 2025-11-24T08:19:00.290869Z

Good morning lovely people

👋🏼 1
ray 2025-11-24T08:30:00.494019Z

Good morning

😃 1
Ludger Solbach 2025-11-24T09:08:00.440269Z

You can try this with a longer exposure time, if your camera allows for it.

thomas 2025-11-24T12:18:37.562959Z

Going down?

1
ray 2025-11-24T16:53:15.438919Z

@lsolbach maybe next time 🙂

2025-11-24T09:20:57.944999Z

morning

dharrigan 2025-11-24T09:29:13.586929Z

Good Morning!

flowthing 2025-11-24T11:06:40.031059Z

Wonder if it would be possible to implement an https://www.archunit.org/use-cases-like thing for Clojure using clj-kondo. 🤔 Perhaps by looking at namespace segments. Things like "`app.persistence.*` must not require app.service.*". Or maybe something like this already exists and I don't know about it...?

borkdude 2025-11-24T11:10:26.907769Z

it's possible to do this based on clj-kondo analysis, but there's also a dedicated tool for this https://github.com/fabiodomingues/clj-depend which is also available in clojure-lsp

👍 1
flowthing 2025-11-24T11:11:07.889729Z

Thank you! I’ll take a look at clj-depend. 👍🏻

simongray 2025-11-24T12:52:21.784059Z

morning

reefersleep 2025-11-24T14:54:05.390959Z

Is there a nice way to get namespaced maps printed with all keys fully qualified instead of the short form? Evaluating a map with namespaced keys like

{:person/name "Fred" :person/age 50}
in my repl prints the following return value
#:person{:name "Fred", :age 50}
And the latter is really annoying to me. I know how to change the behaviour with (set! *print-namespace-maps* false) and was hoping to use a leiningen profile with
:my-cool-profile-name {:repl-options {:init (set! *print-namespace-maps* false)}}
or similar, and the code does execute, but it doesn't take effect once the REPL is fully initialised - at that point, (= true *print-namespace-maps*) ;=>> true And I thought to myself; these cool folks will have solved this problem already 😄

seancorfield 2025-11-24T15:10:41.684529Z

From the docstring: "It defaults to false, but the REPL binds to true." -- so it is getting bound after :init executes, I suspect? Looks like there's no way to globally override it.

daveliepmann 2025-11-24T15:13:40.247309Z

This snippet handled all but one specific kind of CIDER evaluation on an old project, as I recall

(defmethod print-method clojure.lang.IPersistentMap [m, ^java.io.Writer w]
  (#'clojure.core/print-meta m w)
  (#'clojure.core/print-map m #'clojure.core/pr-on w))

seancorfield 2025-11-24T15:14:12.903819Z

Hmm, looking at the code in clojure.main, (init) should be called inside the REPL bindings so... but I don't know how Leiningen handles :init in :repl-options...

reefersleep 2025-11-24T15:31:42.679549Z

@daveliepmann That's part of the application code then, right? I think we could do (set! *print-namespace-maps* false) somewhere in the application code that is loaded on REPL startup, and I suppose it would work as well.

👍 1
reefersleep 2025-11-24T15:32:19.096649Z

@seancorfield I think we're stuck with leiningen for a while yet 🙂

reefersleep 2025-11-24T15:32:32.205649Z

Thanks both 🙂

imre 2025-11-24T15:46:33.686529Z

have you tried (alter-var-root #'*print-namespace-maps* (constantly false)) ?

imre 2025-11-24T15:46:35.804259Z

in the init

imre 2025-11-24T15:47:21.924239Z

edit: false

imre 2025-11-24T15:48:06.798799Z

although what Sean referenced from the doc might overwrite that too

danieroux 2025-11-24T16:02:20.599299Z

@reefersleep we stick that print-method override in user.clj and it works as expected

reefersleep 2025-11-25T10:12:25.242669Z

Ah, completely forgot about user.clj! Will try that, thank you

reefersleep 2025-11-25T10:13:16.830199Z

@imre it seems like a slightly different way to achieve the same result, like you say, but I'll try

mdiin 2025-11-25T10:36:51.496139Z

Just out of curiosity, why do you find printing namespaced maps in short form annoying?

seancorfield 2025-11-25T14:10:07.217079Z

I'd be curious about that. I checked our codebase at work and we have 58 map literals that use the #:namespace{:key value ..} format so seeing thing printed the same way seems natural to me.

reefersleep 2025-11-25T14:14:55.100709Z

We (regrettably) have deeply nested, wide maps as our central business objects, and it's easy to lose your place when scrolling vertically and horizontally. The maps are all namespaced with what they are, which helps - except when you can't see the namespace on your screen. Better tools should be used for prodding these data structures, of course, but often, a print is what you have at hand.

reefersleep 2025-11-25T14:15:20.994249Z

Also, copy/pasting parts of maps doesn't work as you'd like

➕ 1
reefersleep 2025-11-25T14:39:51.021119Z

or as I'd like. 🙂

➕ 1
imre 2025-11-25T14:43:00.162079Z

> parts of maps this is a real pain with namespace maps, you cannot just copy-paste a key-value-pair from it