Skip to content

Instantly share code, notes, and snippets.

@alandipert
Last active December 20, 2017 03:17
Show Gist options
  • Select an option

  • Save alandipert/1156115 to your computer and use it in GitHub Desktop.

Select an option

Save alandipert/1156115 to your computer and use it in GitHub Desktop.

Revisions

  1. alandipert revised this gist Feb 7, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions fb.clj
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    ;; FizzBuzz, the fib of pattern matching
    ;; with https://github.com/swannodette/match
    ;; with https://github.com/clojure/core.match

    (use '[match.core :only (match)])
    (require '[clojure.core.match :refer [match]])

    (doseq [n (range 1 101)]
    (println (match [(mod n 3) (mod n 5)]
  2. Alan Dipert revised this gist Aug 19, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fb.clj
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@

    (doseq [n (range 1 101)]
    (println (match [(mod n 3) (mod n 5)]
    [0 0] "FizzBizz"
    [0 0] "FizzBuzz"
    [0 _] "Fizz"
    [_ 0] "Buzz"
    :else n)))
  3. Alan Dipert created this gist Aug 19, 2011.
    11 changes: 11 additions & 0 deletions fb.clj
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    ;; FizzBuzz, the fib of pattern matching
    ;; with https://github.com/swannodette/match

    (use '[match.core :only (match)])

    (doseq [n (range 1 101)]
    (println (match [(mod n 3) (mod n 5)]
    [0 0] "FizzBizz"
    [0 _] "Fizz"
    [_ 0] "Buzz"
    :else n)))