This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-31
Channels
- # aatree (1)
- # admin-announcements (3)
- # aws (3)
- # beginners (36)
- # boot (227)
- # cljsrn (27)
- # clojure (57)
- # clojure-czech (6)
- # clojure-miami (8)
- # clojure-poland (17)
- # clojure-russia (113)
- # clojurescript (9)
- # community-development (1)
- # core-async (11)
- # core-matrix (2)
- # core-typed (3)
- # cursive (3)
- # datomic (5)
- # editors (40)
- # emacs (6)
- # heroku (1)
- # hoplon (50)
- # incanter (1)
- # ldnclj (4)
- # luminus (3)
- # mount (1)
- # om (132)
- # onyx (5)
- # proton (3)
- # re-frame (5)
- # spacemacs (1)
- # testing (12)
- # yada (6)
one thing that - as a newbie - feels wrong is the need to put guards around reading from the channel like this
(defn simple-printer [in]
(a/go-loop []
(if-let [item (<! in)]
(println item))
(recur)))
I thought - wrongly in my code at least - that <!
would only read from the channel when data was available but I had to add a guard as I kept reading nil from the channel
@raymcdermott: sure you're not writing nil
to windowed
somewhere?
never mind, seems like that could only happen in window-filter
and it doesn't. <!
should only proceed once there is a value, and if it returns nil
that should mean the channel is closed
@raymcdermott: I took a quick crack at it as well. Not sure if it would meet all your needs, but here ya go: https://gist.github.com/jgdavey/d928136d035645bd15ec