(arities f)
Returns a vector of numbers describing the arities of (multi-bodied):
#()
and (fn [])
.map
or #'+
.#'->
.Includes ##Inf
(Double/POSITIVE_INFINITY
) if the function/macro
is variadic.
Returns a vector of numbers describing the arities of (multi-bodied): - anonymous functions like `#()` and `(fn [])`. - defined functions like `map` or `#'+`. - macros, by passing a var like `#'->`. Includes `##Inf` (`Double/POSITIVE_INFINITY`) if the function/macro is variadic.
(fake-arities arity f)
Returns a function g
wrapping f
so that (arities g)
returns arity
instead of f
's'original arity.
arity
can be a number or a sequence of numbers.
Uses ##Inf
(Double/POSITIVE_INFINITY
) to signify a variadic
arity.
Note that this function is orthogonal to Clojure's native arity
checks and its only intended use is to force the return value of
arities
.
Returns a function `g` wrapping `f` so that `(arities g)` returns `arity` instead of `f`'s'original arity. `arity` can be a number or a sequence of numbers. Uses `##Inf` (`Double/POSITIVE_INFINITY`) to signify a variadic arity. Note that this function is orthogonal to Clojure's native arity checks and its only intended use is to force the return value of [[arities]].
(max-arity f)
Returns the maximum arity of f
with the same semantics as
arities
.
Returns the maximum arity of `f` with the same semantics as `arities`.
(min-arity f)
Returns the minimum arity of f
with the same semantics as
arities
.
Returns the minimum arity of `f` with the same semantics as `arities`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close