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

[Scheme-reports] confusing example in 6.11. Exceptions



I don't quite understand the second example under with-exception-handler:

(call-with-current-continuation
   (lambda (k)
     (with-exception-handler
       (lambda (x)
         (display "something went wrong")
         (newline)
         ’dont-care)
       (lambda ()
         (+ 1 (raise ’an-error))))))

First - does the call-with-current-continuation call
actually do anything?  I.e. how is this example different
from:

(with-exception-handler
   (lambda (x)
     (display "something went wrong")
     (newline)
     ’dont-care)
   (lambda ()
     (+ 1 (raise ’an-error))))

Second, raise states "If the handler returns, a secondary
exception is raised in the same dynamic environment as the handler."
That to me means the effect of the with-exception-handler
is to raise an exception handled by some top-level handler.
However, the example says the expression evaluates to <unspecified>
- i.e. it should actually return.
-- 
	--Per Bothner
per@x   http://per.bothner.com/

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports