Last active
December 21, 2015 15:58
-
-
Save swannodette/6330038 to your computer and use it in GitHub Desktop.
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
(defn words-proc [words button interval interval-control scrub] | |
(go (loop [idx 0] | |
(show-word! words idx) | |
(let [[v c] (alts! [button interval scrub]) | |
(condp = c | |
button (do (>! interval-control v) | |
(recur idx)) | |
interval (recur (inc idx)) | |
scrub (do (>! interval-control :stop) | |
(recur v))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment