1.2.0 permalink Arrow_down_16x16
  • (letfn- fn-bindings & exprs)
OBSOLETE: use clojure.core/letfn
A variant of let for local function definitions. fn-bindings consists
of name/args/body triples, with (letfn [name args body] ...)
being equivalent to (let [name (fn name args body)] ...).

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/macros.clj:28 top

(defmacro letfn-
  "OBSOLETE: use clojure.core/letfn
   A variant of let for local function definitions. fn-bindings consists
   of name/args/body triples, with (letfn [name args body] ...)
   being equivalent to (let [name (fn name args body)] ...)."
  [fn-bindings & exprs]
  (let [makefn (fn [[name args body]] (list name (list 'fn name args body)))
	fns (vec (apply concat (map makefn (partition 3 fn-bindings))))]
  `(let ~fns ~@exprs)))
Vars in clojure.contrib.macros/letfn-: defmacro let concat list seq
Used in 0 other vars

Comments top

No comments for letfn-. Log in to add a comment.