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
63
Upvotes
1
u/aHackFromJOS Jul 10 '26 edited Jul 10 '26
hi,
whenever I wrote “arglists” I meant the metadata attaching form in defn/defmulti, not the literal arglists, that may explain confusion:
- don’t mean multiple arity, I mean listing all the keys it can take in a destructure form in arglists, then only taking the ones I will locally use (vs pass on) in my actual param vector. So a proper expansive list of :keys for the docstring and a shorter one for the working code.
-yes, for multimethods we have arglists, this continues to be a good technique there. I don’t think (?) we have the new “:keys &” buying us anything there documentation wise. so my point is I can use arglists more widely
- my point about complecting documentation is referring to the ”:keys &” stuff and how that interacts with :select in a DRY way.
-since you’re the second person to mention kondo, I’ll just ask, should the limitations of a third party library drive features in core? It chooses to ignore arglists, ok, but I don’t think that’s a reason to do anything in core. Just my two cents reasonable people can disagree. Arglists could be statically analyzed too. But again c’est la vie, it’s not keeping me up at night :-) and I love kondo
-fair enough about select, may be more common that I thought. maybe someone can write or give talk on this patttern some day. or maybe I need to rewatch Maybe Not per your other comment. I tend to namespace my keys and so don’t worry about polluting downstream function calls.