I asked this on clojurians, with not much success.
I’m trying to define a binary multimethod. Here is what I have.
(defmulti typep "a doc string" (fn [& others] (let [a-value nil type-designator nil] (println (list :typep others a-value type-designator)) (if (seq? type-designator) (first type-designator) type-designator)))) (defmethod typep :sigma [_ _] true)
The code is defined in a name space which I’m required with
When I call
(ty/typep 3 :sigma) I get the error:
clojure-rte.core> (ty/typep 1 :sigma) Execution error (ArityException) at clojure-rte.core/eval38624 (form-init8934354515316755715.clj:3267). Wrong number of args (2) passed to: clojure-rte.type/eval38515/fn--38516 clojure-rte.core>
Any clue about what I’m doing wrong?
BTW I changed the anonymous function def to use
[& others] because I wanted to see what it is being called with, but apparently the error occurs before it reaches that point, because the
println doesn’t seem to happen.