Dispatch functions take a Class
argument and return the looked-up value.
This provides similar functionality to Clojure's protocols, but operates over
locally-constructed logic rather than using a global dispatch table.
A simple example is a map from classes to values, which can be used directly as a lookup function.
Dispatch functions take a `Class` argument and return the looked-up value. This provides similar functionality to Clojure's protocols, but operates over locally-constructed logic rather than using a global dispatch table. A simple example is a map from classes to values, which can be used directly as a lookup function.
(chained-lookup dispatchers)
(chained-lookup a b & more)
chains two or more lookups together
(chained-lookup (inheritance-lookup printer/clojure-handlers) (inheritance-lookup printer/java-handlers))
chains two or more lookups together (chained-lookup (inheritance-lookup printer/clojure-handlers) (inheritance-lookup printer/java-handlers))
(inheritance-lookup dispatch)
checks if items inherit from the handlers
((inheritance-lookup printer/clojure-handlers) clojure.lang.Atom) => fn?
((inheritance-lookup printer/clojure-handlers) String) => nil
checks if items inherit from the handlers ((inheritance-lookup printer/clojure-handlers) clojure.lang.Atom) => fn? ((inheritance-lookup printer/clojure-handlers) String) => nil
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |