Created
December 5, 2018 09:25
-
-
Save kaffein/160c895594c1bac07eafe8c42d4ec8a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async/<!! | |
(async/go-loop [n 0 acc {}] | |
(if (< n 10) | |
;; keep aggregating values | |
(recur (inc n) (assoc acc n (* n n))) | |
;; done aggregating, return the accumulated values | |
acc))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gives :
{0 0, 7 49, 1 1, 4 16, 6 36, 3 9, 2 4, 9 81, 5 25, 8 64}