diff options
author | Chouser <chouser@n01se.net> | 2010-02-15 15:06:39 -0500 |
---|---|---|
committer | Chouser <chouser@n01se.net> | 2010-02-15 15:06:39 -0500 |
commit | 0a1bfc9b4a1d5e20365d1905806eaf61e13c6db1 (patch) | |
tree | 4311a71a64d8fc909360899623d456e2b3275bc0 | |
parent | 7362d7b5efb9947dfa9d90e79c1cd1daa7fbc085 (diff) |
trace: fix previous commit -- no longer generate infinite recursion.
-rw-r--r-- | src/main/clojure/clojure/contrib/trace.clj | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/clojure/clojure/contrib/trace.clj b/src/main/clojure/clojure/contrib/trace.clj index a38c0383..a75953e7 100644 --- a/src/main/clojure/clojure/contrib/trace.clj +++ b/src/main/clojure/clojure/contrib/trace.clj @@ -88,9 +88,10 @@ 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/+" - [fn-names & exprs] - `(binding [~@(interleave fn-names - (for [func fn-names] - `(fn [& args#] - (trace-fn-call '~func (var ~func) args#))))] + [fnames & exprs] + `(binding [~@(interleave fnames + (for [fname fnames] + `(let [f# @(var ~fname)] + (fn [& args#] + (trace-fn-call '~fname f# args#)))))] ~@exprs)) |