Tools for working with multimethods.
Tools for working with multimethods.
(derive! h child parent)
Although hierarchies are mostly used by indirection as vars (defmulti
supports the :hierarchy
argument for using hierarchies other than the default global one), and although (derive child parent)
implicitly side-effects the global hierarchy, (derive h child parent)
is a pure
function of a hierarchy as a map structure which doesn't behave nicely when given a var.
Wrap it up with an alter-var-root so it makes sense.
Although hierarchies are mostly used by indirection as vars (`defmulti` supports the `:hierarchy` argument for using hierarchies other than the default global one), and although `(derive child parent)` implicitly side-effects the global hierarchy, `(derive h child parent)` is a pure function of a hierarchy as a map structure which doesn't behave nicely when given a var. Wrap it up with an alter-var-root so it makes sense.
Make a function which dispatches on the #'type
tuple of the first N arguments, silently absorbing
the rest.
Make a function which dispatches on the `#'type` tuple of the first N arguments, silently absorbing the rest.
(type x)
Dispatch function for switching on, in order
:type
of an object:type
metadataThe logical extension of Clojure's #'type
operator to the :type
pattern.
Dispatch function for switching on, in order - The declared `:type` of an object - The `:type` metadata - The Java type The logical extension of Clojure's `#'type` operator to the `:type` pattern.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close