(handler key args ...)
key is a symbol or #t.
thunk takes no arguments. If thunk returns normally, that
is the return value of
Handler is invoked outside the scope of its own
handler again throws to the same key, a new handler from further
up the call chain is invoked.
If the key is
#t, then a throw to any symbol will match
this call to
key is a symbol. It will match catches of the same symbol or of #t.
If there is no handler at all, an error is signaled.
misc-errorand a message constructed by displaying msg and writing args.
#f. message is the error message string, possibly containing
%sescapes. When an error is reported, these are replaced by formating the corresponding members of args:
write. data is a list or
#fdepending on key: if key is
system-errorthen it should be a list containing the Unix
errnovalue; If key is
signalthen it should be a list containing the Unix signal number; otherwise it will usually be
#fis returned instead.
It is traditional in Scheme to implement exception systems using
call-with-current-continuation, but his has not been done, for
performance reasons. The implementation of
call-with-current-continuation is a stack copying implementation.
This allows it to interact well with ordinary C code. Unfortunately, a
stack-copying implementation can be slow -- creating a new continuation
involves a block copy of the stack.
Instead of using
call-with-current-continuation, the exception
primitives are implemented as built-ins that take advantage of the
upward only nature of exceptions.
Go to the first, previous, next, last section, table of contents.