Utility functions for implementing method combinations.
Utility functions for implementing method combinations.
(add-implicit-arg arg fn-tail)
Add an implicit arg
to the beginning of the arglists for every arity of fn-tail
.
Add an implicit `arg` to the beginning of the arglists for every arity of `fn-tail`.
(add-implicit-next-method-args qualifier fn-tail)
Add an implicit next-method
arg to the beginning of primary and :around
fn tails; :before
and :after
tails
are left as-is.
Add an implicit `next-method` arg to the beginning of primary and `:around` fn tails; `:before` and `:after` tails are left as-is.
(apply-around-methods combined-method around-methods)
Combine around-methods
into combined-method
, returning a new even-more-combined method. Each around method is
partially bound with a next-method
arg. Normally, this applies around methods least-specific-first (e.g. Person
before Child).
Combine `around-methods` into `combined-method`, returning a new even-more-combined method. Each around method is partially bound with a `next-method` arg. Normally, this applies around methods least-specific-first (e.g. Person before Child).
(combine-primary-methods primary-methods)
Combine all primary-methods
into a single combined method. Each method is partially bound with a next-method
arg.
Combine all `primary-methods` into a single combined method. Each method is partially bound with a `next-method` arg.
(transform-fn-tail f fn-tail)
Transform fn-tail
using f, a function that operates on a single ([params*] expr*)
form. For single-arity
functions, this applies f
directly to fn-tail
; for functions overloaded with multiple arities, this maps f
across all arities.
Transform `fn-tail` using f, a function that operates on a single `([params*] expr*)` form. For single-arity functions, this applies `f` directly to `fn-tail`; for functions overloaded with multiple arities, this maps `f` across all arities.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close