1.2.0 permalink Arrow_down_16x16

trace-fn-call

clojure.contrib.trace

  • (trace-fn-call name f args)
Traces a single call to a function f with args. 'name' is the
symbol name of the function.

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:64 top

(defn trace-fn-call
  "Traces a single call to a function f with args.  'name' is the
  symbol name of the function."
  [name f args]
  (let [id (gensym "t")]
    (tracer id (str (trace-indent) (pr-str (cons name args))))
    (let [value (binding [*trace-depth* (inc *trace-depth*)]
                  (apply f args))]
      (tracer id (str (trace-indent) "=> " (pr-str value)))
      value)))
Vars in clojure.contrib.trace/trace-fn-call: cons defn let name pr-str str
Used in 0 other vars

Comments top

No comments for trace-fn-call. Log in to add a comment.