Skip to content

Instantly share code, notes, and snippets.

@atroche
Created October 25, 2016 21:49
Show Gist options
  • Save atroche/899a01b4662ef7d8cb6debdd5cb80282 to your computer and use it in GitHub Desktop.
Save atroche/899a01b4662ef7d8cb6debdd5cb80282 to your computer and use it in GitHub Desktop.
;; via http://blog.klipse.tech//clojure/2016/10/25/core-match.html
(doseq [n (range 1 11)]
(println
(match [(mod n 3) (mod n 5)]
[0 0] "FizzBuzz"
[0 _] "Fizz"
[_ 0] "Buzz"
:else n)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment