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


6.7 Use with returnable bodies

The unwind–protection mechanism has special integration with the returnable syntax (see returnable); if an unwind–protection syntax is used in the body of returnable and return is used in the body forms: the unwind handler is evaluated correctly. We have to remember that return is implemented by an escaping continuation.

(define y #f)

(returnable
  (with-unwind-handler
      (lambda (why)
        (set! y #t))
    (lambda ()
      (return 1))))
⇒ 1
y ⇒ #t

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

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