Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vemv opened this issue Jun 17, 2019 · 0 comments
Open

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

vemv opened this issue Jun 17, 2019 · 0 comments

Comments

@vemv
Copy link
Contributor

vemv commented Jun 17, 2019

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant