Support defmethod argcount validation #130
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #59
This is implemented as a separate thing you have to opt-in to rather than using
:arglists
directly so we don't blow up in cases where people are using a human-friendly arglist like[x y? & {:as options]]
.:defmethod-arities
A set of allowed/required arities that
defmethod
forms are allowed to have.defmethod
forms must have arities thatmatch all of the specified
:defmethod-arities
, and all of its arities must be allowed by:defmethod-arities
::defmethod-arities
must be a set of either integers or[:> n]
forms to represent arities with&
restarguments, e.g.
[:>= 3]
to mean an arity of three or-more arguments:When rest-argument arities are used, Methodical is smart enough to allow them when appropriate even if they do not
specifically match an arity specified in
:defmethod-arities
: