Skip to content

Instantly share code, notes, and snippets.

@bostonou
Created August 29, 2013 15:19
Show Gist options
  • Save bostonou/6379446 to your computer and use it in GitHub Desktop.
Save bostonou/6379446 to your computer and use it in GitHub Desktop.
(defn =?
[a b]
(= a b))
(defn channel=?
[a c]
(thread (=? a (<!! c))))
(def partial=? (partial =? 10))
(let [c (chan)
chan-result (channel=? 10 c)]
; do some stuff...
(let [_ (thread (>!! c 10)) ; give channel=? it's last arg
partial-result (partial=? 10)] ; give partial=? it's last arg
{:channel (<!! chan-result)
:partial partial-result}))
; => {:channel true :partial true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment