-
Notifications
You must be signed in to change notification settings - Fork 3
Description
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 xwill 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
specsis a vector with a positive count. - specs are ANDed.