Traces a single call to a function f with args. 'name' is the
symbol name of the function.
(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)))
Comments top
No comments for trace-fn-call. Log in to add a comment.