SHARE
TWEET

Untitled

a guest Dec 17th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn getvals [chans]
  2.     (a/go-loop [i 0 vals []]
  3.         (if (< i (count chans))
  4.             (recur (inc i) (conj vals (a/<! (nth chans i))))
  5.             vals
  6.         )
  7.     )
  8. )
  9.    
  10.  
  11. (defn eq-chans [chans r]
  12.     (a/go-loop []
  13.    
  14.         (def vals (getvals chans))
  15.        
  16.         (when (every? some? vals)
  17.             (when (apply = vals)
  18.                 (a/>! r (first vals))
  19.             )
  20.             (recur)
  21.         )
  22.     )
  23. )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top