Case macro for the different kinds of tyspecseq structures.
This is an ACL2::fty sum-type case macro, typically introduced by fty::defflexsum or fty::deftagsum. It allows you to safely check the type of a tyspecseq structure, or to split into cases based on its type.
In its short form,
(tyspecseq-case x :void)
is essentially just a safer alternative to writing:
(equal (tyspecseq-kind x) :void)
Why is using tyspecseq-case safer? When we directly inspect the
kind with
In its longer form,
(tyspecseq-case x :void ... :char ... :schar ... :uchar ... :sshort ... :ushort ... :sint ... :uint ... :slong ... :ulong ... :sllong ... :ullong ... :bool ... :float ... :double ... :ldouble ... :struct ... :union ... :enum ... :typedef ...)
It is also possible to consolidate ``uninteresting'' cases using
For convenience, the case macro automatically binds the fields of