Skip to content

clojure.core/defn

View this page on ClojureDocs

Type: macro Added: Clojure 1.0 Examples: 11 Runnable: 5
([name doc-string? attr-map? [params*] prepost-map? body] [name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?])

Same as (def name (fn [params* ] exprs*)) or (def name (fn ([params* ] exprs*)+)) with any doc-string or attrs added to the var metadata. prepost-map defines a map with optional keys :pre and :post that contain collections of pre or post conditions.

Examples

by nipra on . May have evaluation errors.
by kotarak on . May have evaluation errors.
by pkolloch on
by AtKaaZ on . May have evaluation errors.
by dxlr8r on
by ibercode on
by jakubholynet on . May have evaluation errors.
by victorb on . May have evaluation errors.
by cljlc on
by boraseoksoon on
by mdave16 on . May have evaluation errors.

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.