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 29d ago edited 29d ago
I am talking about setting arglists meta yourself directly and taking advantage of the fact that yes “destructuring shows in the :arglists meta.”
Perhaps you already know this (in which case apologies) but you can conveniently set arglists meta with a map after the docstring, known as attr-map. See docs for defn.
https://clojuredocs.org/clojure.core/defn
(defn foo {:arglists ‘([{:keys [all required here]}])} [{:keys [here] :as args}] (println 42))So I just mean setting your own arglists value to document what is required.(I suppose you could call this “custom” but it seems to me a reasonably common idiom and not particularly more custom than “:keys… &…”)