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...
For use with `class` as the dispatch-fn. Investigate to see whether this significantly impacts performance.
Vanilla Clojure multimethods don't support this, but it seems like it would be a good feature to add
Where they make sense. Since the operator method combinations are all essentially map-reduce operations, maybe there's some way to generalize this and make any of the operator method combinations parallel?
CLOS supports `:most-specific-last` options for the operator method combinations. Here's an example from [Practical Common Lisp](http://www.gigamonkeys.com/book/object-reorientation-generic-functions.html): ```common-lisp (defgeneric priority (job) (:documentation "Return the priority at which the job should be...
There's really no good reason not to support them, other than CLOS not supporting them. It would be pretty easy to implement them I think.
The default implementation can throw an error for primary methods or silently do nothing for aux methods. You could implement this to do something like custom ambiguity resolution for primary...
The caching mechanism assumes that only the most-specific primary method will be called. If a `:toucan` is a `:bird` and a `:toucan` is a `:can`, and we have methods for...
One possibility is that multimethods that normally use compound dispatch values can throw an error if you add a dispatch value with the wrong number of args (except for `:default`).
We should be able to define new operator method combinations like `merge` inline without having to use `defoperator` to define something.
In hindsight it's a little silly to have one tiny little protocol live in its own namespace.