Utilities for working with multimethods.
Utilities for working with multimethods.
(defmethod-explicit multifn dispatch-val & fn-tail)In a standard defmethod body you have no direct reference to the dispatch value itself. Instead, you'd have to hardcode it as a literal or look it up from somewhere else.
This macro allows you to opt into naming the dispatch value to a name via :as DV:
(defmethod-explicit my-multi :bar :as the-dv [x] (str the-dv :-> x))
Shadowing DV in the arglist will nullify the utility of the named dispatch value.
In a standard defmethod body you have no direct reference to the dispatch value itself.
Instead, you'd have to hardcode it as a literal or look it up from somewhere else.
This macro allows you to opt into naming the dispatch value to a name via ``:as DV``:
(defmethod-explicit my-multi :bar :as the-dv [x] (str the-dv :-> x))
Shadowing ``DV`` in the arglist will nullify the utility of the named dispatch value.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |