1.2.0 permalink Arrow_down_16x16
  • (dotrace fnames & exprs)
Given a sequence of function identifiers, evaluate the body
expressions in an environment in which the identifiers are bound to
the traced functions. Does not work on inlined functions,
such as clojure.core/+

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/trace.clj:86 top

(defmacro dotrace
  "Given a sequence of function identifiers, evaluate the body
   expressions in an environment in which the identifiers are bound to
   the traced functions.  Does not work on inlined functions,
   such as clojure.core/+"
  [fnames & exprs]
  `(binding [~@(interleave fnames
                           (for [fname fnames]
                             `(let [f# @(var ~fname)]
                                (fn [& args#]
                                  (trace-fn-call '~fname f# args#)))))]
     ~@exprs))
Vars in clojure.contrib.trace/dotrace: defmacro for interleave apply binding concat deref fn let list seq vector
Used in 0 other vars

Comments top

1 comment(s) for dotrace.

A good example of how to use dotrace can be found here.

Log in to add a comment.