Liking cljdoc? Tell your friends :D

arity.core


aritiesclj

(arities f)

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.

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

fake-aritiesclj

(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]].
sourceraw docstring

max-arityclj

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

min-arityclj

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

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

× close