[plt-scheme] exn:break-continuation

From: Eric Dobson (endobson at cs.brown.edu)
Date: Tue May 25 17:54:48 EDT 2010

I am having trouble using the continuation in a exn:break struct. I
have a program which I think should catch the first exception,
continue and then exit on the second one. The problem is that upon
invoking the continuation, mzscheme says that I am trying to jump into
an escape continuation. It seems to me that the continuation in an
exn:break struct should not be an escape-continuation, otherwise what
is the point of having it?

#!/usr/bin/env mzscheme
#lang scheme

(define caught #f)
(printf "starting~n")
(define k
 (with-handlers ((exn:break? (lambda (exn)
                                (if caught
                                    (printf "exiting")
                                      (set! caught #t)
                                      (printf "break~n")
                                      ((exn:break-continuation exn)))))))
   (let loop () (loop))))


Posted on the users mailing list.