[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Scheme-reports] 4.2.7. Exception Handling


The docs for `guard' note that if no cond clause matches, that the
exception is re-raised:

   "then `raise' is re-invoked on the raised object within the dynamic
   extent of the original call to `raise' except that the current
   exception handler is that of the `guard' expression."

But it also notes that the exception handler's continuation and dynamic
context are that of the guard expression.

What does it mean to specify that the object is re-raised from the
original `raise' dynamic context?  AFAICS there is no way to know what
the dynamic context is at the time of `raise', as the dynamic state is
unwound before invoking the handler.

Here's a program:

   (define p (make-parameter 0))
   (define f
     (lambda () 
       (guard (e ((p)))
         (parameterize ((p (+ (p) 1)))
           (raise #t)))))

What should `(f)' evaluate to, 0 or 1?


Scheme-reports mailing list