Tracing Function Calls
There is a trace package that allows tracing function calls:
(load-file "cs378/trace.clj") user=> (trace (* 2 3)) TRACE: 6 6
(deftrace factorial [n] (if (= n 0) 1 (* n (factorial (- n 1))))) user=> (factorial 4) TRACE t256: (factorial 4) TRACE t257: | (factorial 3) TRACE t258: | | (factorial 2) TRACE t259: | | | (factorial 1) TRACE t260: | | | | (factorial 0) TRACE t260: | | | | => 1 TRACE t259: | | | => 1 TRACE t258: | | => 2 TRACE t257: | => 6 TRACE t256: => 24 24