Last active
December 21, 2015 05:28
-
-
Save steveshogren/6256803 to your computer and use it in GitHub Desktop.
Copied fromTim Visher's tools.trace documentation https://github.com/timvisher/what-does-tools-trace-do/blob/master/src/what_does_tools_trace_do/core.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; trace-forms "Trace all the forms in the given body. Returns any | |
;; underlying uncaught exceptions that may make the forms fail." | |
(trace-forms | |
(let [a (+ 1 1) | |
b (* 2 2) | |
c (* a b (/ 4 0))] | |
c)) | |
;; => ArithmeticException Divide by zero | |
;; Form failed: (/ 4 0) | |
;; Form failed: (* a b (/ 4 0)) | |
;; Form failed: (let* [a (+ 1 1) b (* 2 2) c (* a b (/ 4 0))] c) | |
;; Form failed: (let [a (+ 1 1) b (* 2 2) c (* a b (/ 4 0))] c) | |
;; clojure.lang.Numbers.divide (Numbers.java:156) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment