2 ms·
In this snippet parentheses are in the wrong place (defmacro nil-throws [form] `(let [result# ~form] ;; assign the evaluation of form to result#
by perfunctory 7y ago
In this snippet parentheses are in the wrong place
(defmacro nil-throws [form]
`(let [result# ~form] ;; assign the evaluation of form to result#
(if (nil? result#)
(throw
(ex-info "uh oh, we got nil!" {:form '~form}) ;; save form for inspection
result#))))
I guess, should be
(defmacro nil-throws [form]
`(let [result# ~form] ;; assign the evaluation of form to result#
(if (nil? result#)
(throw
(ex-info "uh oh, we got nil!" {:form '~form})) ;; save form for inspection
result#)))
- stopachka 7y agoGreat catch! Updated, thank you :)