Skip to content

NEXT FAIL SKIP macro

Masataro Asai edited this page Apr 24, 2015 · 2 revisions
(match '(:a 2)
  ((list :a x)
   (if (zerop (mod x 3))
       'fizz
       (fail))))
  ((list :a x)
   (if (zerop (mod x 5))
       'buzz
       (fail)))))

Trivia has Optima’s FAIL macro with the same functionality, but this symbol is loaded optionally. This is because the symbol FAIL is so common in many other libraries, notably in fiveam and other testing libraries. Therefore, we export FAIL in a separate package trivia.fail, and you should :use it manually.

We also provide other aliases. You can use NEXT with trivia.next package, and SKIP by trivia.skip. NEXT also conflicts with symbol iterate:next. Fortunately, to our knowledge, there is no famous library exporting SKIP.