Liking cljdoc? Tell your friends :D

methodical.util

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.
raw docstring

add-aux-method!clj

(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.
raw docstring

add-aux-method-with-unique-keyclj

(add-aux-method-with-unique-key multifn qualifier dispatch-val f unique-key)

Adds an auxiliary method with a unique-key stored in its metadata. This unique key can later be used to remove the auxiliary method with remove-aux-method-with-unique-key. If a method with this key already exists for this qualifier and dispatch value, replaces the original.

Adds an auxiliary method with a `unique-key` stored in its metadata. This unique key can later be used to remove the
auxiliary method with `remove-aux-method-with-unique-key`. If a method with this key already exists for this
qualifier and dispatch value, replaces the original.
raw docstring

add-aux-method-with-unique-key!clj

(add-aux-method-with-unique-key! multifn-var
                                 qualifier
                                 dispatch-val
                                 f
                                 unique-key)

Destructive version of add-aux-method-with-unique-key. Operates on a var defining a Methodical multifn.

Destructive version of `add-aux-method-with-unique-key`. Operates on a var defining a Methodical multifn.
raw docstring

add-primary-method!clj

(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.
raw docstring

alter-var-root+clj

(alter-var-root+ multifn-var f & args)

Like alter-var-root, but handles vars that are aliases of other vars, e.g. ones that have been imported via Potemkin import-vars.

Like `alter-var-root`, but handles vars that are aliases of other vars, e.g. ones that have been imported via
Potemkin `import-vars`.
raw docstring

applicable-primary-methodclj

(applicable-primary-method multifn dispatch-value)

Return the primary method that would be use for dispatch-value, including ones from ancestor dispatch values or the default dipsatch value.

Like primary-method, the method returned will not have any implicit args (such as next-method) bound.

Return the primary method that would be use for `dispatch-value`, including ones from ancestor dispatch values or the
default dipsatch value.

Like `primary-method`, the method returned will not have any implicit args (such as `next-method`) bound.
raw docstring

aux-methodsclj

(aux-methods multifn)
(aux-methods multifn dispatch-value)
(aux-methods multifn qualifier dispatch-value)

Get all auxiliary methods explicitly specified for dispatch-value. 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.

  • With 1 arg: methods come back as a map of qualifier -> dispatch value -> [method].
  • With 2 args: methods come back as a map of qualifier -> [method].
  • With 3 args: methods come back as sequence of methods.
Get all auxiliary methods *explicitly specified* for `dispatch-value`. 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.

 *  With 1 arg: methods come back as a map of `qualifier` -> `dispatch value` -> `[method]`.
 *  With 2 args: methods come back as a map of `qualifier` -> `[method]`.
 *  With 3 args: methods come back as sequence of `methods`.
raw docstring

default-aux-methodsclj

(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.
raw docstring

default-effective-methodclj

(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.
raw docstring

default-primary-methodclj

(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.
raw docstring

dispatch-fnclj

(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).
raw docstring

effective-primary-methodclj

(effective-primary-method multifn dispatch-value)

Build and effective method equivalent that would be used for this dispatch-value if it had no applicable auxiliary methods. Implicit args (such as next-method) will be bound appropriately.

Build and effective method equivalent that would be used for this `dispatch-value` if it had no applicable auxiliary
methods. Implicit args (such as `next-method`) will be bound appropriately.
raw docstring

multifn?clj

(multifn? x)

True if x is a Methodical multifn (i.e., if it is an instance of StandardMultiFn).

True if `x` is a Methodical multifn (i.e., if it is an instance of `StandardMultiFn`).
raw docstring

prefer-method!clj

(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.
raw docstring

primary-methodclj

(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. (If you want methods that will be used, including those of ancestors dispatch values, you can use applicable-primary-method or effective-primary-method instead.)

Note that the primary method will not have any implicit args (e.g. next-method) bound the way it normally would when combined into an effective method; you will need to supply this yourself (or pass nil for no next-method).

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. (If you want methods that will be used, including those of ancestors dispatch values, you can
use [[applicable-primary-method]] or [[effective-primary-method]] instead.)

Note that the primary method will not have any implicit args (e.g. `next-method`) bound the way it normally would
when combined into an effective method; you will need to supply this yourself (or pass `nil` for no `next-method`).
raw docstring

remove-all-aux-methodsclj

(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`. 
raw docstring

remove-all-aux-methods!clj

(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.
raw docstring

remove-all-aux-methods-for-dispatch-valclj

(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.
raw docstring

remove-all-aux-methods-for-dispatch-val!clj

(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.
raw docstring

remove-all-methodsclj

(remove-all-methods multifn)

Remove all primary and auxiliary methods, including default implementations.

Remove all primary and auxiliary methods, including default implementations.
raw docstring

remove-all-methods!clj

(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.
raw docstring

remove-all-primary-methodsclj

(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.
raw docstring

remove-all-primary-methods!clj

(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.
raw docstring

remove-aux-method!clj

(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.
raw docstring

remove-aux-method-with-unique-keyclj

(remove-aux-method-with-unique-key multifn qualifier dispatch-val unique-key)

Remove an auxiliary method that was added by add-aux-method-with-unique-key, if one exists. Returns multifn.

Remove an auxiliary method that was added by `add-aux-method-with-unique-key`, if one exists. Returns multifn.
raw docstring

remove-aux-method-with-unique-key!clj

(remove-aux-method-with-unique-key! multifn-var
                                    qualifier
                                    dispatch-val
                                    unique-key)

Destructive version of remove-aux-method-with-unique-key. Operates on a var defining a Methodical multifn.

Destructive version of `remove-aux-method-with-unique-key`. Operates on a var defining a Methodical multifn.
raw docstring

remove-primary-method!clj

(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.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close