Next: unwind except 3, Previous: unwind except 1, Up: unwind [Contents][Index]
A continuable exception is raised with raise-continuable and it is a way to resume the
execution of a chunk of code after raising an exception. This example shows the basic mechanism:
(with-exception-handler
(lambda (E)
(+ E 2))
(lambda ()
(raise-continuable 1)))
⇒ 3
The handling of a continuable exception can be the same of the handling of a non–continuable exception; in addition the exception handler is allowed to return. In the latter case the dynamic extent of the call to ?thunk is not exited, so ?unwind-handler is not called.
The following example shows what happens when ?thunk raises a continuable exception:
(import (only (mmck checks)
with-result
add-result))
(with-result
(with-exception-handler
(lambda (E)
(add-result 'exception-handler)
(+ E 2))
(lambda ()
(with-unwind-handler
(lambda (why)
(add-result 'cleanup))
(lambda ()
(add-result 'thunk-in)
(begin0
(raise-continuable 1)
(add-result 'thunk-out)))))))
⇒ (3 (thunk-in exception-handler thunk-out cleanup))
Next: unwind except 3, Previous: unwind except 1, Up: unwind [Contents][Index]
This document describes version 0.1.0-devel.1 of MMCK Exceptional Conditions.