From d65f076ea2593924b381d64df2a026b0bd7d25e2 Mon Sep 17 00:00:00 2001 From: Cam Saul Date: Thu, 6 Oct 2022 20:44:34 +0000 Subject: [PATCH] README fix --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4772ecf..b9a911e 100644 --- a/README.md +++ b/README.md @@ -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