diff options
author | Chouser <chouser@n01se.net> | 2010-02-15 13:34:33 -0500 |
---|---|---|
committer | Chouser <chouser@n01se.net> | 2010-02-15 13:35:15 -0500 |
commit | 7362d7b5efb9947dfa9d90e79c1cd1daa7fbc085 (patch) | |
tree | 370d1b5e65ae80630531eb9cbd1028f26fe08378 | |
parent | 31748856f90ce77c304d5acdde84c25b4688d407 (diff) |
trace: Allow dotrace to work on private var fns.
-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)) |