Skip to content

Instantly share code, notes, and snippets.

@gszeliga
Created December 6, 2017 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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