aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/trace.clj
diff options
context:
space:
mode:
authorStuart Halloway <stu@thinkrelevance.com>2009-08-05 17:00:17 -0500
committerStuart Halloway <stu@thinkrelevance.com>2009-08-05 17:00:17 -0500
commit2d0079c159a37740173bbe289daca41e48723bfd (patch)
treed164adc5447834943be2248d16266c8716f8a810 /src/clojure/contrib/trace.clj
parent6c95fe90829cc66f81345a011dc25fc487e4cf0b (diff)
minor fix to deftrace: traced functions can now refer to themselves
Diffstat (limited to 'src/clojure/contrib/trace.clj')
-rw-r--r--src/clojure/contrib/trace.clj9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/clojure/contrib/trace.clj b/src/clojure/contrib/trace.clj
index 70a20dbb..1ac00a70 100644
--- a/src/clojure/contrib/trace.clj
+++ b/src/clojure/contrib/trace.clj
@@ -77,6 +77,9 @@ code is doing."}
arguments. Nested calls to deftrace'd functions will print a
tree-like structure."
[name & definition]
- `(let [f# (fn ~@definition)]
- (defn ~name [& args#]
- (trace-fn-call '~name f# args#))))
+ `(do
+ (def ~name)
+ (let [f# (fn ~@definition)]
+ (defn ~name [& args#]
+ (trace-fn-call '~name f# args#)))))
+