• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • 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
              • Patbind-ok
              • Reserrf-push
                • Defresult-macro-definition
                • Reserrf
                • Patbind-okf
              • Deffixtype
              • Defoption
              • Fty-discipline
              • Fold
              • Fty-extensions
              • Defsubtype
              • Deftypes
              • Specific-types
              • Defset
              • 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
        • Mailing-lists
        • Interfacing-tools
      • Macro-libraries
        • B*
        • Defunc
        • Fty
          • Deftagsum
          • Defprod
          • Defflexsum
          • Defbitstruct
          • Deflist
          • Defalist
          • Defbyte
          • Deffixequiv
          • Defresult
            • Reserr
            • Reserr-option
            • Patbind-ok
            • Reserrf-push
              • Defresult-macro-definition
              • Reserrf
              • Patbind-okf
            • Deffixtype
            • Defoption
            • Fty-discipline
            • Fold
            • Fty-extensions
            • Defsubtype
            • Deftypes
            • Specific-types
            • Defset
            • 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
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Defresult

      Reserrf-push

      Push the current function onto the stack of an error result, optionally with additional information.

      This is useful when receiving an error result from a called function, to add the caller to the stack, and possibly more information, before propagating the error. This addition is handled automatically when using patbind-okf, actually using nil as extra information; when that binder cannot be used for some reason, or when additional information must be pushed, then this reserrf-push macro may come handy.

      This assumes that __function__ is bound to the current function name, which is automatically the case when using define.

      Macro: reserrf-push

      (defmacro reserrf-push (error &optional info)
       (cons
        'b*
        (cons
         (cons (cons 'stack
                     (cons (cons 'reserr->info (cons error 'nil))
                           'nil))
               'nil)
         (cons
          (cons
            'reserr
            (cons (cons 'cons
                        (cons (cons 'list
                                    (cons '__function__ (cons info 'nil)))
                              '(stack)))
                  'nil))
          'nil))))