Skip to content

Commit

Permalink
README fix
Browse files Browse the repository at this point in the history
  • Loading branch information
camsaul committed Oct 6, 2022
1 parent 8396408 commit d65f076
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -541,13 +541,16 @@ match *all* of the specified `:defmethod-arities`, and all of its arities must b
arguments, e.g. `[:>= 3]` to mean an arity of three *or-more* arguments:

```clj
;; methods must both a 1-arity and a 3+-arity
;; methods must have both a 1-arity and a 3+-arity
(m/defmulti ^:private mf
{:arglists '([x] [x y z & more]), :defmethod-arities #{1 [:>= 3]}}
keyword)

(m/defmethod mf :x ([x] x) ([x y z & more] x))
;; => ok

(m/defmethod mf :x [x y] x)
;; => error: {:arities {:required #{1 [:>= 3]}, :disallowed #{2}}}
```

When rest-argument arities are used, Methodical is smart enough to allow them when appropriate even if they do not
Expand Down

0 comments on commit d65f076

Please sign in to comment.