diff options
-rw-r--r-- | src/main/clojure/clojure/contrib/trace.clj | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main/clojure/clojure/contrib/trace.clj b/src/main/clojure/clojure/contrib/trace.clj index ccfc5ef1..a38c0383 100644 --- a/src/main/clojure/clojure/contrib/trace.clj +++ b/src/main/clojure/clojure/contrib/trace.clj @@ -88,11 +88,9 @@ code is doing."} expressions in an environment in which the identifiers are bound to the traced functions. Does not work on inlined functions, such as clojure.core/+" - [fns & exprs] - (if (empty? fns) - `(do ~@exprs) - (let [func (first fns) - fns (next fns)] - `(let [f# ~func] - (binding [~func (fn [& args#] (trace-fn-call '~func f# args#))] - (dotrace ~fns ~@exprs)))))) + [fn-names & exprs] + `(binding [~@(interleave fn-names + (for [func fn-names] + `(fn [& args#] + (trace-fn-call '~func (var ~func) args#))))] + ~@exprs)) |