Utility functions for performing additional operations on multifns and their components not specified in one of the interfaces. These functions are compositions of those methods.
Utility functions for performing additional operations on multifns and their components not specified in one of the interfaces. These functions are compositions of those methods.
(add-aux-method! multifn-var qualifier dispatch-val f)
Destructive version of add-aux-method
. Operates on a var defining a Methodical multifn.
Destructive version of `add-aux-method`. Operates on a var defining a Methodical multifn.
(add-primary-method! multifn-var dispatch-val f)
Destructive version of add-primary-method
. Operates on a var defining a Methodical multifn.
Destructive version of `add-primary-method`. Operates on a var defining a Methodical multifn.
(aux-methods multifn dispatch-value)
Get all auxiliary methods explicitly specified for dispatch-value
. Methods come back as a map of qualifier
->
methods
. This function does not include methods that would otherwise still be applicable (e.g., methods for
ancestor dispatch values) -- the methods explicitly defined for this exact match.
Get all auxiliary methods *explicitly specified* for `dispatch-value`. Methods come back as a map of `qualifier` -> `methods`. This function does not include methods that would otherwise still be applicable (e.g., methods for ancestor dispatch values) -- the methods explicitly defined for this exact match.
(default-aux-methods multifn)
Get a map of aux qualifer -> methods for the default dispatch value, if any exist.
Get a map of aux qualifer -> methods for the default dispatch value, if any exist.
(default-effective-method multifn)
Return the effective (combined) method for the default dispatch value, if one can be computed.
Return the effective (combined) method for the default dispatch value, if one can be computed.
(default-primary-method multifn)
Get the default primary method associated with this mutlifn
, if one exists.
Get the default primary method associated with this `mutlifn`, if one exists.
(dispatch-fn multifn)
Return a function that can be used to calculate dispatch values of given arg(s).
Return a function that can be used to calculate dispatch values of given arg(s).
(prefer-method! multifn-var dispatch-val-x dispatch-val-y)
Destructive version of prefer-method
. Operates on a var defining a Methodical multifn.
Note that vanilla Clojure prefer-method
is actually itself destructive, so this function is actually the
Methodical equivalent of that function. prefer-method!
is used by Methodical to differentiate the operation from
our nondestructive prefer-method
, which returns a copy of the multifn with an altered dispatch table.
Destructive version of `prefer-method`. Operates on a var defining a Methodical multifn. Note that vanilla Clojure `prefer-method` is actually itself destructive, so this function is actually the Methodical equivalent of that function. `prefer-method!` is used by Methodical to differentiate the operation from our nondestructive `prefer-method`, which returns a copy of the multifn with an altered dispatch table.
(prefers? multifn dispatch-val-x dispatch-val-y)
Does this multifn's dispatcher have an explict preference specified (i.e., via prefer-method
) for
dispatch-val-x
over dispatch-val-y
?
Does this multifn's dispatcher have an *explict* preference specified (i.e., via `prefer-method`) for `dispatch-val-x` over `dispatch-val-y`?
(primary-method multifn dispatch-value)
Get the primary method explicitly specified for dispatch-value
. This function does not return methods that would
otherwise still be applicable (e.g., methods for ancestor dispatch values) -- just the methods explicitly defined
for this exact match.
Get the primary method *explicitly specified* for `dispatch-value`. This function does not return methods that would otherwise still be applicable (e.g., methods for ancestor dispatch values) -- just the methods explicitly defined for this exact match.
(remove-all-aux-methods multifn)
(remove-all-aux-methods multifn qualifier)
(remove-all-aux-methods multifn qualifier dispatch-value)
With one arg, remove all auxiliary methods for a multifn
. With two args, remove all auxiliary methods for the
given qualifier
(e.g. :before
). With three args, remove all auxiliary methods for a given qualifier
and
dispatch-value
.
With one arg, remove *all* auxiliary methods for a `multifn`. With two args, remove all auxiliary methods for the given `qualifier` (e.g. `:before`). With three args, remove all auxiliary methods for a given `qualifier` and `dispatch-value`.
(remove-all-aux-methods! multifn-var)
(remove-all-aux-methods! multifn-var qualifier)
(remove-all-aux-methods! multifn-var qualifier dispatch-val)
Destructive version of remove-all-aux-methods
. Operates on a var defining a Methodical multifn.
Destructive version of `remove-all-aux-methods`. Operates on a var defining a Methodical multifn.
(remove-all-aux-methods-for-dispatch-val multifn dispatch-value)
Remove all auxiliary methods for dispatch-value
for all qualifiers.
Remove all auxiliary methods for `dispatch-value` for *all* qualifiers.
(remove-all-aux-methods-for-dispatch-val! multifn-var dispatch-value)
Destructive version of remove-all-aux-methods-for-dispatch-val
. Operates on a var defining a Methodical multifn.
Destructive version of `remove-all-aux-methods-for-dispatch-val`. Operates on a var defining a Methodical multifn.
(remove-all-methods multifn)
Remove all primary and auxiliary methods, including default implementations.
Remove all primary and auxiliary methods, including default implementations.
(remove-all-methods! multifn-var)
Destructive version of remove-all-methods
. Operates on a var defining a Methodical multifn.
Destructive version of `remove-all-methods`. Operates on a var defining a Methodical multifn.
(remove-all-primary-methods multifn)
Remove all primary methods, for all dispatch values (including the default value), for this multifn
or method
table.
Remove all primary methods, for all dispatch values (including the default value), for this `multifn` or method table.
(remove-all-primary-methods! multifn-var)
Destructive version of remove-all-primary-methods
. Operates on a var defining a Methodical multifn.
Destructive version of `remove-all-primary-methods`. Operates on a var defining a Methodical multifn.
(remove-aux-method! multifn-var qualifier dispatch-val f)
Destructive version of remove-aux-method
. Operates on a var defining a Methodical multifn.
Destructive version of `remove-aux-method`. Operates on a var defining a Methodical multifn.
(remove-primary-method! multifn-var dispatch-val)
Destructive version of remove-primary-method
. Operates on a var defining a Methodical multifn.
Destructive version of `remove-primary-method`. Operates on a var defining a Methodical multifn.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close