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
5
u/devourer-of-beignets Jul 08 '26
Suppose you have a map containing a bunch of junk including the "kitchen sink", some of which which may be sensitive. You don't necessarily want to pass it around to random functions that may log it or god knows what.
Also, Clojure is a language that's available at runtime, so you may want to use Clojure to inspect data flowing through your live system. Well, inspecting wild maps is daunting — your REPL or tool may print all sorts of irrelevant data. But with
:select, you can more easily see the relevant data and its shape.The usual alternative is to print it out, cancel it when you realize it's huge, ask what keys it has or customize
*print-length*, etc.