Multicase
Macro that allows matching on multiple sum types or enums at once.
Usage:
(multicase macro-pairs cases)
where:
- macro-pairs is a list of pairs (casemacro variable)
- cases is a list of forms (match [ :when cond ] value)
- match is either a wildcard &, -, or :otherwise (all with the same meaning) or else a list the same length as macro-pairs, where the element corresponding to a given casemacro/variable pair is either a wildcard or else a keyword appropriate for that casemacro
- cond and value are terms.
An instructive example can be found in books/centaur/fty/tests/multicase.lisp.
This macro depends on other case macros such as those generated by deftagsum, defflexsum, deftranssum, and def-enumcase. In particular, it depends on these case macros allowing an :otherwise* keyword which acts as a wildcard but disappears (without error) when the other cases are exhaustive.