(df fn-name & fn-contents)
Makes a defn definition, parsing the arglist as described in parse-arglist. As with clojure.core/defn, a docstring and pre/post conditions are optional.
Makes a defn definition, parsing the arglist as described in parse-arglist. As with clojure.core/defn, a docstring and pre/post conditions are optional.
(lam & fn-contents)
Makes a fn definition, parsing the arglist as described in parse-arglist. fn name is optional. Like clojure.core/fn, will not accept a docstring, but pre/post conditions are optional.
Makes a fn definition, parsing the arglist as described in parse-arglist. fn name is optional. Like clojure.core/fn, will not accept a docstring, but pre/post conditions are optional.
(parse-arglist arglist)
Walks an arg list and replaces any list with the last s-exp in the list, which must be a symbol that will become the name of the argument. A special case for a list that begins with the keyword 'hint' which will add a type hint when replacing the list. The return is a map with this new arglist, and a vector of original removed lists. i.e. If the input arglist is: [(int? a) [[b (string? c) (hint bool f)] (foo? d)]]: the output would be: {:arglist [a [[b c ^bool f] d]] :predicates [(int? a) (string? c) (foo? d)]}.
Walks an arg list and replaces any list with the last s-exp in the list, which must be a symbol that will become the name of the argument. A special case for a list that begins with the keyword 'hint' which will add a type hint when replacing the list. The return is a map with this new arglist, and a vector of original removed lists. i.e. If the input arglist is: [(int? a) [[b (string? c) (hint bool f)] (foo? d)]]: the output would be: {:arglist [a [[b c ^bool f] d]] :predicates [(int? a) (string? c) (foo? d)]}.
(write-function defn-or-fn fn-name docstring args body)
Returns the quoted syntax for a defn or fn, by parsing the arglist as described in parse-arglist and inserting the assertions. The body is the entire function body, which may optionally include pre/post conditions. The assertions will be inserted after the pre/post if present. fn-name can be nil in the case of a fn, but not a defn. Docstring may be nil.
Returns the quoted syntax for a defn or fn, by parsing the arglist as described in parse-arglist and inserting the assertions. The body is the entire function body, which may optionally include pre/post conditions. The assertions will be inserted after the pre/post if present. fn-name can be nil in the case of a fn, but not a defn. Docstring may be nil.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close