Skip to main content

Functions

  • comp

    Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable numb...

  • constantly

    Returns a function that takes any number of arguments and returns x.

  • defn

    Same as (def name (fn [params* ] exprs*)) or (def name (fn ([params* ] exprs*)+)) with any doc-string or attrs added...

  • defn-

    same as defn, yielding non-public def

  • fn

    params => positional-params*, or positional-params* & rest-param positional-param => binding-form rest-param => bind...

  • identity

    Returns its argument.

  • partial

    Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of addition...

  • bounded-count

    If coll is counted? returns its count, else will count at most the first n elements of coll using its seq

  • comparator

    Returns an implementation of java.util.Comparator based upon pred.

  • ffirst

    Same as (first (first x))

  • fnext

    Same as (first (next x))

  • iteration

    Creates a seqable/reducible via repeated calls to step, a function of some (continuation token) 'k'. The first call to...

  • max-key

    Returns the x for which (k x), a number, is greatest. If there are multiple such xs, the last one is returned.

  • min-key

    Returns the x for which (k x), a number, is least. If there are multiple such xs, the last one is returned.

  • nfirst

    Same as (next (first x))

  • nnext

    Same as (next (next x))

  • apply

    Applies fn f to the argument list formed by prepending intervening arguments to args.

  • comp

    Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable numb...

  • complement

    Takes a fn f and returns a fn that takes the same arguments as f, has the same effects, if any, and returns the opposi...

  • completing

    Takes a reducing function f of 2 args and returns a fn suitable for transduce by adding an arity-1 signature that call...

  • every-pred

    Takes a set of predicates and returns a function f that returns true if all of its composing predicates return a logic...

  • fnil

    Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x...

  • juxt

    Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable nu...

  • memoize

    Returns a memoized version of a referentially transparent function. The memoized version of the function keeps a cache...

  • some-fn

    Takes a set of predicates and returns a function f that returns the first logical true value returned by one of its co...

  • trampoline

    trampoline can be used to convert algorithms requiring mutual recursion without stack consumption. Calls f with suppli...

  • fn?

    Returns true if x implements Fn, i.e. is an object created via fn.

  • ifn?

    Returns true if x implements IFn. Note that many data structures (e.g. sets and maps) implement IFn

  • ->

    Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a...

  • ->>

    Threads the expr through the forms. Inserts x as the last item in the first form, making a list of it if it is not a ...

  • as->

    Binds name to expr, evaluates the first form in the lexical context of that binding, then binds name to that result, r...

  • cond->

    Takes an expression and a set of test/form pairs. Threads expr (via ->) through each form for which the corresponding ...

  • cond->>

    Takes an expression and a set of test/form pairs. Threads expr (via ->>) through each form for which the corresponding...

  • some->

    When expr is not nil, threads it into the first form (via ->), and when that result is not nil, through the next etc

  • some->>

    When expr is not nil, threads it into the first form (via ->>), and when that result is not nil, through the next etc