Created
July 28, 2010 17:55
-
-
Save candera/495545 to your computer and use it in GitHub Desktop.
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
(defn nfe-test [] | |
(try | |
(let [nums (map #(Integer/parseInt %) ["1" "2" "1234123412341234"])] | |
(when (every? #(< 3 %) nums) | |
nums)) | |
(catch NumberFormatException nfe nil))) | |
(nfe-test) ;; throws NumberFormatException, but I would expect it to | |
;; return nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah, someone on IRC helped me figure that out. It's highly non-obvious, although it makes sense once I understood it. And it also drives home why checked exceptions totally suck.