Liking cljdoc? Tell your friends :D

defns.core

Core defns namespace.

Core defns namespace.
raw docstring

applies?clj

(applies? fn-var args)

Checks if the passed parameter vector conforms to the type signature from the passed var's metadata. Also checks arity. Returns true if satisfied, otherwise false. Does not invoke the function.

Checks if the passed parameter vector conforms to the type signature from
the passed var's metadata. Also checks arity. Returns true if satisfied,
otherwise false. Does not invoke the function.
sourceraw docstring

Boolclj

source

defnscljmacro

(defns name signature params body)

Takes a name, type signature vector, parameter vector and a body and defines a new function using them. Behaves like defn, but adding additional metadata and adding :pre and :post conditions.

Adds(merges) the following map to metadata: {:signature - the type signature, vector if TypeSpecifications :p - parameter part of the type signature :r - result type :pretty-signature - the string representation of the type signature }

Creates the :pre condition such that applies the type predicate to the corresponding parameter and checks if all conformed. Creates :post condition that applies the result type predicate to the result.

Throws Exception if signature is not valid and/or function arity doesn't match with the signature.

Takes a name, type signature vector, parameter vector and a body and
defines a new function using them. Behaves like defn, but adding additional
metadata and adding :pre and :post conditions.

Adds(merges) the following map to metadata:
{:signature - the type signature, vector if TypeSpecifications
 :p - parameter part of the type signature
 :r - result type
 :pretty-signature - the string representation of the type signature
}

Creates the :pre condition such that applies the type predicate to the
corresponding parameter and checks if all conformed. Creates :post
condition that applies the result type predicate to the result.

Throws Exception if signature is not valid and/or function arity
doesn't match with the signature.
sourceraw docstring

deftcljmacro

(deft type-name predicate)

Defines a new TypeSpecification instance i.e. a new type.

Defines a new TypeSpecification instance i.e. a new type.
sourceraw docstring

Fnclj

source

GenericTypeclj

source

Intclj

source

Keyclj

source

Nilclj

source

Pclj

source

prettify-sigclj

(prettify-sig signature)

Converts a vector of TypeSpecifications to a vector of Strings representing their names.

Converts a vector of TypeSpecifications to a vector of
Strings representing their names.
sourceraw docstring

pretty-sigclj

(pretty-sig fn-var)

Returns the prettified signature from the passed var's metadata if any.

Returns the prettified signature from the passed var's metadata if any.
sourceraw docstring

sigclj

(sig fn-var)

Returns the type signature from the passed var's metadata if any.

Returns the type signature from the passed var's metadata if any.
sourceraw docstring

signature-valid?clj

(signature-valid? signature params-count)

Check if type signature vector conforms to the signature spec. Also checks if number of parameters in the signature is equal to the passed number. Returns true if both are true, otherwise throws Exception.

Check if type signature vector conforms to the signature spec. Also
checks if number of parameters in the signature is equal to the passed
number. Returns true if both are true, otherwise throws Exception.
sourceraw docstring

Strclj

source

Tclj

source

valid-result?clj

(valid-result? fn-var arg)

Checks if passed value conforms to the return type signature from the passed var's metadata. Returns true if satisfied, otherwise false. Does not invoke the function.

Checks if passed value conforms to the return type signature from the
passed var's metadata. Returns true if satisfied, otherwise false.
Does not invoke the function.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close