[Scheme-reports] confusing example in 6.11. Exceptions Per Bothner (11 Dec 2012 19:40 UTC)

[Scheme-reports] confusing example in 6.11. Exceptions Per Bothner 11 Dec 2012 19:38 UTC

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@bothner.com   http://per.bothner.com/

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