Created
May 21, 2014 14:37
-
-
Save tmoerman/2d71eccf730889f3f782 to your computer and use it in GitHub Desktop.
Threading macro and core.async
This file contains hidden or 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
(def c (chan)) | |
(defn exception? [x] (instance? Exception x)) | |
(defn throwable? [x] (instance? Throwable x)) | |
(-> c | |
(->> (map*< #(/ 5 %)) | |
(split (complement throwable?))) | |
(-< (->> (first) | |
(map*< (fn [x] (prn ":) " x))) | |
(suck)) | |
(->> (second) | |
(map*< (fn [e] (prn ":( " e))) | |
(suck)))) | |
(put! c 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment