3 ms·
Not that I subscribe to 'elegance' but...this example was in a recent article on core.match, and it's really terse: (with-out-str (doseq [n (range 1 11)]
by spacemanmatt 10y ago
Not that I subscribe to 'elegance' but...this example was in a recent article on core.match, and it's really terse:
(with-out-str (doseq [n (range 1 11)]
(println
(match [(mod n 3) (mod n 5)]
[0 0] "FizzBuzz"
[0 _] "Fizz"
[_ 0] "Buzz"
:else n))))