Skip to content

Document destructuring of singleton map sequences#733

Open
kovan wants to merge 1 commit intoclojure:masterfrom
kovan:docs/destructure-singleton-map
Open

Document destructuring of singleton map sequences#733
kovan wants to merge 1 commit intoclojure:masterfrom
kovan:docs/destructure-singleton-map

Conversation

@kovan
Copy link

@kovan kovan commented Mar 14, 2026

Adds a subsection to the Destructuring guide explaining that since Clojure 1.11 (CLJ-2603), associative destructuring of a sequence containing a single map binds directly to the map's contents.

Includes examples showing both the singleton behavior and the traditional multi-element alternating key-value behavior.

Verified against core.clj destructure/pmap function: when the value is a seq with exactly one element, it uses (first gmap) directly.

Fixes #688

Since Clojure 1.11 (CLJ-2603), associative destructuring of a sequence
containing a single map binds directly to the map's contents.

Verified against core.clj destructure/pmap function (lines 4472-4476):
when the value is a seq with exactly one element, it uses (first gmap)
directly rather than treating the seq as alternating key-value pairs.

Fixes clojure#688
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document destructuring of singleton map sequences

1 participant