• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
        • Deftagsum
        • Defprod
        • Defflexsum
        • Defbitstruct
        • Deflist
        • Defalist
        • Defbyte
        • Deffixequiv
        • Defresult
          • Reserr
          • Reserr-option
            • Reserr-optionp
            • Reserr-option-fix
            • Reserr-option-case
              • Reserr-option-equiv
              • Reserr-option-some
              • Reserr-option-none
            • Patbind-ok
            • Reserrf-push
            • Defresult-macro-definition
            • Reserrf
            • Patbind-okf
          • Deffixtype
          • Defoption
          • Fty-discipline
          • Fold
          • Fty-extensions
          • Defsubtype
          • Defset
          • Deftypes
          • Specific-types
          • Defflatsum
          • Deflist-of-len
          • Defbytelist
          • Defomap
          • Fty::basetypes
          • Defvisitors
          • Deffixtype-alias
          • Deffixequiv-sk
          • Defunit
          • Multicase
          • Deffixequiv-mutual
          • Fty::baselists
          • Def-enumcase
          • Defmap
        • Apt
        • Std/util
        • Defdata
        • Defrstobj
        • Seq
        • Match-tree
        • Defrstobj
        • With-supporters
        • Def-partial-measure
        • Template-subst
        • Soft
        • Defthm-domain
        • Event-macros
        • Def-universal-equiv
        • Def-saved-obligs
        • With-supporters-after
        • Definec
        • Sig
        • Outer-local
        • Data-structures
      • ACL2
        • Theories
        • Rule-classes
        • Proof-builder
        • Recursion-and-induction
        • Hons-and-memoization
        • Events
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
          • Make-event
          • Defmacro
          • Untranslate-patterns
          • Tc
          • Trans*
          • Macro-aliases-table
          • Macro-args
          • Defabbrev
          • User-defined-functions-table
          • Trans
          • Untranslate-for-execution
          • Add-macro-fn
          • Check-vars-not-free
          • Safe-mode
          • Macro-libraries
            • B*
            • Defunc
            • Fty
              • Deftagsum
              • Defprod
              • Defflexsum
              • Defbitstruct
              • Deflist
              • Defalist
              • Defbyte
              • Deffixequiv
              • Defresult
                • Reserr
                • Reserr-option
                  • Reserr-optionp
                  • Reserr-option-fix
                  • Reserr-option-case
                    • Reserr-option-equiv
                    • Reserr-option-some
                    • Reserr-option-none
                  • Patbind-ok
                  • Reserrf-push
                  • Defresult-macro-definition
                  • Reserrf
                  • Patbind-okf
                • Deffixtype
                • Defoption
                • Fty-discipline
                • Fold
                • Fty-extensions
                • Defsubtype
                • Defset
                • Deftypes
                • Specific-types
                • Defflatsum
                • Deflist-of-len
                • Defbytelist
                • Defomap
                • Fty::basetypes
                • Defvisitors
                • Deffixtype-alias
                • Deffixequiv-sk
                • Defunit
                • Multicase
                • Deffixequiv-mutual
                • Fty::baselists
                • Def-enumcase
                • Defmap
              • Apt
              • Std/util
              • Defdata
              • Defrstobj
              • Seq
              • Match-tree
              • Defrstobj
              • With-supporters
              • Def-partial-measure
              • Template-subst
              • Soft
              • Defthm-domain
              • Event-macros
              • Def-universal-equiv
              • Def-saved-obligs
              • With-supporters-after
              • Definec
              • Sig
              • Outer-local
              • Data-structures
            • Trans1
            • Defmacro-untouchable
            • Set-duplicate-keys-action
            • Add-macro-alias
            • Magic-macroexpand
            • Defmacroq
            • Trans!
            • Remove-macro-fn
            • Remove-macro-alias
            • Add-binop
            • Untrans-table
            • Trans*-
            • Remove-binop
            • Tcp
            • Tca
          • Interfacing-tools
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Reserr-option

      Reserr-option-case

      Case macro for the different kinds of reserr-option structures.

      This is an fty sum-type case macro, typically introduced by defflexsum or deftagsum. It allows you to safely check the type of a reserr-option structure, or to split into cases based on its type.

      Short Form

      In its short form, reserr-option-case allows you to safely check the type of a reserr-option structure. For example:

      (reserr-option-case x :none)

      can be used to determine whether x is a none instead of some other kind of reserr-option structure.

      Long Form

      In its longer form, reserr-option-case allows you to split into cases based on the kind of structure you are looking at. A typical example would be:

      (reserr-option-case x
        :none ...
        :some ...)

      It is also possible to consolidate ``uninteresting'' cases using :otherwise.

      For convenience, the case macro automatically binds the fields of x for you, as appropriate for each case. That is, in the :none case, you can use defprod-style foo.bar style accessors for x without having to explicitly add a none b* binder.