Skip to content

Create a ^{::speced/specs []} directive  #71

@vemv

Description

@vemv

Context

Attaching multiple specs to the same symbol is forbidden by u.s and made impossible by the Clojure reader (for some cases; but I don't want to create a pattern that works sometimes)

Rationale: in ^String ^Object x will be read as ^{:tag String} ^{:tag Object} x. Given the identical key name (:tag), either annotation will be silently dropped.

Adding that second spec needs a {:pre [(check! ...)]}, which is cumbersome.

Task

Implement a ^{::speced/specs [::spec1 ::spec2]} 'syntax' (directive), analog to the existing ^{::speced/spec ::a-single-spec} one.

Thoughts

I think this feature would shine (vs. the existing ^{::speced/spec ::spec}) if it accepted class names that would expand to type hints as usual: ^{::speced/specs [SomeClass ::spec2]}, also ^{::speced/specs [string? ::spec2]}.

Else the feature would be only marginally better than a vanilla (s/and ...)

Acceptance criteria

  • it is validated that specs is a vector with a positive count.
  • specs are ANDed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions