Skip to content

Update destructuring grammar for Clojure 1.13-alpha4 #3107

Description

@cmf

In Clojure 1.13-alpha4, one part of the grammar for checked-key destructuring vectors changed:

  ;; Before
  (s/+ ident?)

  ;; After
  (s/+ any?)

These are the elements appearing after & in forms such as:

  {:keys! [required-key & optional-key]}

Before the change, every element after & had to satisfy ident?—that is, be a symbol or keyword. Afterward, those
non-binding elements may be any Clojure value/form, including strings, numbers, collections, or other valid map keys:

  {:keys! [required-key & "string-key" 42 [:composite :key]]}

The key distinction is that elements before & create local bindings and therefore retain their type restrictions.
Elements after & only identify keys and do not introduce bindings, so restricting them to identifiers was unnecessarily
narrow. The change applied to :keys, :syms, :strs, and their checked ! variants because they share the
::non-binding-elements spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    changedMarks issues describing changes to existing featuresreleased-eapMarks issues which have had the fixes released in an EAP build

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions