Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@swannodette
Last active December 21, 2015 15:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swannodette/6330038 to your computer and use it in GitHub Desktop.
Save swannodette/6330038 to your computer and use it in GitHub Desktop.
(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