Next: , Previous: , Up: syntaxes   [Contents][Index]


5.3 Blocking exceptions

Sometimes we want to block raised exceptions, for example when we are already handling a previously raised exception.

Syntax: with-blocked-exceptions <thunk>
Syntax: with-blocked-exceptions <exception-retvals-maker> <thunk>

Evaluate <thunk> and return its return values.

When used with one argument: if <thunk> raises an exception, return the raised object.

When used with two arguments: if <thunk> raises an exception, apply the procedure <exception-retvals-maker> to the raised object and return its return values. Exceptions raised by <exception-retvals-maker> are not blocked.

Usage examples:

(with-blocked-exceptions
  (lambda ()
    (raise 99)))
⇒ 99

(with-blocked-exceptions
    (lambda (E)
      (values E 1 2 3))
  (lambda ()
    (raise 99)))
⇒ 99 1 2 3

Next: , Previous: , Up: syntaxes   [Contents][Index]

This document describes version 0.1.0-devel.1 of MMCK Exceptional Conditions.