[core.specs] Destructuring spec is overly restrictive in namespaced :keys

Description

Namespaced :keys destructuring (see https://clojure.atlassian.net/browse/CLJ-1919#icft=CLJ-1919) supports any kind of ident in a `::foo/keys` or `::foo/syms`, but the core spec says only `simple-symbol?` is allowed.

Example:

Expected:

Proposed: Widen spec for this case from `simple-symbol?` to `ident?` (which the code supports).
Patch: clj-2473.patch

Environment

None

Attachments

1

Activity

Show:

Alex Miller January 31, 2019 at 6:14 PM

I considered that and decided to match the code. There is also consistency with :keys.

Thomas Heller January 31, 2019 at 5:39 PM

ident? accepts namespaced keywords (and symbols) which probably should not be allowed given that the current implementation will ignore the namespace and use the namespace used by "keys" instead. To avoid confusion the spec should, in my opinion, be restricted to simple-keyword? or simple-symbol? in the namespaced "keys" case and only accept ident? for non-namespaced :keys.

Details

Assignee

Reporter

Approval

Vetted

Patch

Code

Priority

Affects versions

Created January 31, 2019 at 3:41 PM
Updated May 16, 2024 at 8:16 PM