methodical
methodical copied to clipboard
Functional and flexible multimethods for Clojure. Nondestructive multimethod construction, CLOS-style aux methods and method combinations, partial-default dispatch, easy next-method invocation, helpf...
Vanilla multimethods use `:default` -- this is a little confusing.
need to add some tests before this is g2g
I replaced `definterface+` with `definterface` for further clojurescript support #20. UPD: Also I replaced `deftype+` with `deftype`. Helper functions are not inlined like potemkin do because I not see any...
CLOS has this. The default could just throw an Exception about there not being an impl like it does anyway. But maybe there's a use-case for customizing this behavior.
Add some macroexpansion-time error checking if the multifunction has `^:arglists` metadata to check that the method matches a known argument count. Example: ```clj (m/defmulti mf {:arglists '([x y])} (fn [x...
So the usual functions like `clojure.core/defmethod` and the like can be used. This will make Methodical a true drop-in replacement. Need to figure out how this will work since `clojure.lang.MultiFn`...
Something like this would be a game-changer. See also #46 ```clj (m/defmulti my-multimethod "WOW" keyword) (:doc (meta #'my-multimethod)) -> "WOW" (m/defmethod my-multimethod :x [_]) (:doc (meta #'my-multimethod)) -> "WOW Primary...
ClojureScript has a stripped-down implementation of vars and does not have the `alter-var-root!` function. How to store multifn in atom like clojurescript does? https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/core.cljc#L2768 Or maybe just use mutable field?...
This code ```clj (m/defmulti multifn {:arglists '([x y z])} (fn [x y _] [(keyword x) (keyword y)])) ;; oops, I should have used defmethod! (m/defmulti multifn :default [x y z]...