clojure 2026-09-22

if i have a vector of maps and i assoc that vector into 3 separate entries of a new map, the entries are only holding pointers to the heap-allocated vector of maps, right? until i actually update or change the vector (or any nested maps), there's no additional allocations?

1

The more the merrier

In the latest 1.13.0 alpha is there a way to specify the exception thrown by :keys! ? Currently it's IllegalArgumentException on the first key missing, but I want to throw it specifying all the missing keys.

Alex Miller (Clojure team) 2026-09-22T19:21:55.338879Z

no, you should use :missing and do that yourself if needed

💡 1
Alex Miller (Clojure team) 2026-09-22T19:36:51.770349Z

it's important to note here that there are two reasons keys may be missing: 1) your program is wrong (in which case, you probably want :keys! to learn this during development), or 2) your user passed incomplete data at runtime - better use case for :missing

I see, will look into it. Thanks!

1.13 opens up never seen before possibilities of truly expressing how you feel about your data.

$ clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.13.0-alpha6"}}}' -J-Dclojure.spec.skip-macros=true
Clojure 1.13.0-alpha6
user=> (let [{:keys-i-like-very-much [foo bar baz] :keys-that-are-stupid-and-boring [x y z]} {:foo 1 :x 2}] [foo bar baz x y z])
[1 nil nil 2 nil nil]

😂 11
😎 1

disclaimer: this is all off spec

Just (s/def :clojure.core.spec.alpha/map-bindings any?) and it's "on spec" again. ;) What's a small spec override between two friends - you and Clojure.

😂 2

https://github.com/puredanger ... pure danger indeed 😜

😉 1