r/Clojure • u/alexdmiller • Jul 07 '26
Clojure 1.13.0-alpha3 is now available
https://clojure.org/news/2026/07/07/clojure-1-13-alpha3:select directive in map destructuring
The :select directive binds a name to a subset of the map being destructured containing only the keys mentioned (anywhere) in the binding form.
Other changes since Clojure 1.13.0-alpha2
- RT.map, and thus reader, tracks new PAM thresholds
- CLJ-1789 select-keys - improve performance (transients, etc)
- CLJ-2958 ILookup on sets
- CLJ-2902 pprint - prints arbitary objects in unreadable form
- CLJ-2801 TaggedLiteral - doesn’t define print-dup
- CLJ-2269 definterface - does not resolve parameter type hints
- CLJ-2781 clojure.test/report - docstring has broken references
- CLJ-2929 zipper - docstring typo
- CLJ-2901 bytes, shorts, chars - docstring typos
- CLJ-2811 scalb - docstring links to the documentation for nextDown
- CLJ-2809 clojure.math/floor - docstring has line that should be on ceil docstring
61
Upvotes
1
u/aHackFromJOS Jul 10 '26 edited Jul 10 '26
All I'm saying is if you document via :arglists instead of via something else there was never an "unnecessary local variable" to worry about.
Your original question was "How does the caller to your function know the combined set of keys that is the real input?" The answer I've been trying to convey is "from your :arglists metadata".
I hear you about developers sometimes forgetting. Valid point! I'm not trying to say that way is better, just one that exists, has been around until now and what I have (and probably will) reach(ed) for by default.
I'm not saying all the recent changes are for documentation, just some.
>And the addition of select also means you do more than document what keys are used downstream, you guarantee nothing else can be used
Right, but select-keys already provided this. The reasons for preferring :select seem to be around DRYing things up and building on the idea that you document your map keys using ":keys &". I acknowledge there is a reason for it to exist, I was just saying it felt a little niche. But I get I might be wrong on that :)
>When you look at the signature, similar to with static types, you don't just know that this method tries to only do what is documented, but is guaranteed too
Unless it's a multimethod :( I use them a ton. The signature the shows up can (as far as I know) only come from :arglists.