Skip to content

Instantly share code, notes, and snippets.

@gszeliga
Created December 6, 2017 14:59
Show Gist options
  • Save gszeliga/2456c5844fd30aed0af1da261db8783e to your computer and use it in GitHub Desktop.
Save gszeliga/2456c5844fd30aed0af1da261db8783e to your computer and use it in GitHub Desktop.
(defn w-aggregate [channel]
(go-loop [c 0 s 0.0]
(if-some [n (<! channel)]
(recur (inc c) (+ n s))
[s c])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment