Created
January 21, 2016 23:33
-
-
Save noisesmith/4fb0b6fec934128d89e1 to your computer and use it in GitHub Desktop.
clojure core.async/reduce
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
user=> (require '[clojure.core.async :as >]) | |
nil | |
user=> (def c (>/chan)) | |
#'user/c | |
user=> (def s (>/reduce str "" c)) | |
#'user/s | |
user=> (>/>!! c "hello") | |
true | |
user=> (>/>!! c ", ") | |
true | |
user=> (>/>!! c "world!") | |
true | |
user=> (>/close! c) | |
nil | |
user=> (>/<!! s) | |
"hello, world!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment