Posted By

narkisr on 01/28/10


Tagged

function tracing REPL


Versions (?)

Clojure REPL Tracing


 / Published in: Clojure
 

URL: http://groups.google.com/group/clojure/browse_thread/thread/ee9abad24909386e

Using contrib's trace ns in order to debug functions in the REPL

  1. user> (use 'clojure.contrib.trace)
  2. nil
  3. user> (defn foo [coll] (reduce + coll))
  4. #'user/foo
  5. user> (defn bar [coll] (map inc coll))
  6. #'user/bar
  7. user> (dotrace [foo bar] (foo (bar [1 1 1])))
  8. TRACE t7043: (bar [1 1 1])
  9. TRACE t7043: => (2 2 2)
  10. TRACE t7044: (foo (2 2 2))
  11. TRACE t7044: => 6

Report this snippet  

You need to login to post a comment.