Changes for clojure.contrib.trace/deftrace

Claj on Fri, 30 Dec 2011
;;Example courtesy to Jonas Enlund on clojure@googlegroups.com 2011-12-30:

(ns trc.core
 (:use [clojure.tools.trace :only [deftrace]]))

(deftrace fib [n]
 (if (or (= n 0) (= n 1))
     1
     (+ (fib (- n 1)) (fib (- n 2)))))

the following is printed when (fib 4) is evaluated:

TRACE t2302: (fib 4)
TRACE t2303: | (fib 3)
TRACE t2304: | | (fib 2)
TRACE t2305: | | | (fib 1) 
TRACE t2305: | | | => 1
TRACE t2306: | | | (fib 0)
TRACE t2306: | | | => 1
TRACE t2304: | | => 2
TRACE t2307: | | (fib 1)
TRACE t2307: | | => 1
TRACE t2303: | => 3
TRACE t2308: | (fib 2)
TRACE t2309: | | (fib 1)
TRACE t2309: | | => 1
TRACE t2310: | | (fib 0)
TRACE t2310: | | => 1
TRACE t2308: | => 2
TRACE t2302: => 5
Claj on Fri, 30 Dec 2011
;;Example courtesy to Jonas Edlund on clojure@googlegroups.com 2011-12-30:

(ns trc.core
 (:use [clojure.tools.trace :only [deftrace]]))

(deftrace fib [n]
 (if (or (= n 0) (= n 1))
     1
     (+ (fib (- n 1)) (fib (- n 2)))))

the following is printed when (fib 4) is evaluated:

TRACE t2302: (fib 4)
TRACE t2303: | (fib 3)
TRACE t2304: | | (fib 2)
TRACE t2305: | | | (fib 1) 
TRACE t2305: | | | => 1
TRACE t2306: | | | (fib 0)
TRACE t2306: | | | => 1
TRACE t2304: | | => 2
TRACE t2307: | | (fib 1)
TRACE t2307: | | => 1
TRACE t2303: | => 3
TRACE t2308: | (fib 2)
TRACE t2309: | | (fib 1)
TRACE t2309: | | => 1
TRACE t2310: | | (fib 0)
TRACE t2310: | | => 1
TRACE t2308: | => 2
TRACE t2302: => 5