Clojure REPL Tracing


/ Published in: Clojure
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.