clojure-europe

teodorlu 2026-04-15T07:36:41.083439Z

morning! 🙌

thomas 2026-04-15T08:05:48.875479Z

morning

simongray 2026-04-15T08:50:14.689299Z

good morning

simongray 2026-04-15T08:51:12.287479Z

I was teaching bachelor students yesterday. It went quite well even though I started at 14:40 and their first class was at 8:00.

🎉 6
imre 2026-04-15T08:53:51.171219Z

good morning

Ludger Solbach 2026-04-15T09:45:09.993959Z

Good morning!

plexus 2026-04-15T09:59:48.650059Z

When I need a keyword as a string, without the :, but preserving the namespace, I always did (subs (str kw) 1), which seems to be the established pattern to do this. BUT turns out you can also do (str (symbol kw)), which looks nicer IMO and is also a little faster.

➕ 3
🤘 1
5
slipset 2026-04-16T07:50:29.655669Z

I also much prefer the semantics of (str (symbol kw)) over (subs (str kw) 1) The former kinda speaks in the language of Clojure, the latter reads like a hack.

👍 4
plexus 2026-04-16T07:56:00.966259Z

that's what I meant with "looks nicer" 🙂

💜 1
Ben Sless 2026-04-15T11:02:08.045389Z

Not a little, relatively speaking

plexus 2026-04-15T11:09:09.897359Z

oh yeah? quick microbenchmarking gave me maybe 10~20% improvement

Ben Sless 2026-04-15T11:09:51.489189Z

20% is not a little It's not orders of magnitude but not negligible imo

plexus 2026-04-15T11:11:03.976369Z

I guess it depends on a lot on what you're doing for this to show up in overall numbers

Ben Sless 2026-04-15T11:11:27.425499Z

"It depends" Dammit 😁

borkdude 2026-04-15T11:20:10.787489Z

This works since clojure 1.10 which explains the historical way of doing it

plexus 2026-04-15T11:22:12.556179Z

yeah I thought it might be something like that but don't have an encyclopedic memory of API changes 🙂

borkdude 2026-04-15T11:24:06.078639Z

I just have a command line in which I can try this out ;)

1
😅 1
simongray 2026-04-15T11:00:36.245719Z

Anybody here getting any mileage out of Cognitect's anomalies?

seancorfield 2026-04-19T16:33:42.662149Z

Finally got around to reading up on hierarchies and defmulti -- that's very nice @mpenet Thank you!

❤️ 1
simongray 2026-04-16T08:31:13.046409Z

Very cool. I think I’ll just use them for basic categorisation and nothing else.

simongray 2026-04-15T11:02:52.240999Z

I am considering improving my user-facing error pages based on this article https://mbezjak.github.io/posts/exception-translation/ and I was pondering whether to combine this with anomalies, using those as a categorisation system

seancorfield 2026-04-15T12:59:41.219789Z

I think we use them at work but not extensively. I like the idea. There's a library that is inspired by anomalies the extends the idea into actual exceptions. Not at my desk but I think it's from @mpenet company?

mpenet 2026-04-15T13:00:09.917789Z

yes! https://github.com/exoscale/ex

mpenet 2026-04-15T13:04:04.650229Z

we actually use it a lot. We have hierarchies of keywords that we use in ex-infos that then later dict behavior/handling in various contexts: like logging, alerting, http statuses and whatnot

mpenet 2026-04-15T13:05:11.669919Z

like foo.compute.vm/not-found child of exoscale.ex/not-found, we then have multimethod for each context that does the right thing from the same hierarchy (:hierarchy opt in defmulti)

👍 1
seancorfield 2026-04-15T13:06:29.999509Z

Interesting. I've never used hierarchies...

mpenet 2026-04-15T13:06:57.451659Z

(defmulti ex->alert ... :hierarchy ex/hierarchy) (defmulti ex->logging ...) (defmulti ex->http-status ...) etc

mpenet 2026-04-15T13:07:13.157079Z

I love them, it's a hidden gem

ray 2026-04-15T11:19:03.006219Z

Good bouquet morning

🌸 3
plexus 2026-04-15T06:48:20.363099Z

morning!