{"size": 1563, "ext": "scrbl", "max_stars_repo_path": "doc/rnrs/exceptions.scrbl", "max_stars_repo_name": "david135/sagittarius-scheme", "max_stars_repo_stars_event_min_datetime": "2015-11-07T07:13:35.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-15T03:35:14.000Z", "max_issues_repo_path": "doc/rnrs/exceptions.scrbl", "max_issues_repo_name": "david135/sagittarius-scheme", "max_issues_repo_issues_event_min_datetime": "2016-04-28T21:59:59.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-01T08:42:21.000Z", "max_forks_repo_path": "doc/rnrs/exceptions.scrbl", "max_forks_repo_name": "david135/sagittarius-scheme", "max_forks_repo_forks_event_min_datetime": "2016-12-28T12:41:23.000Z", "max_forks_repo_forks_event_max_datetime": "2020-02-26T20:52:02.000Z"}
{"max_stars_count": 39, "max_issues_count": 3, "max_forks_count": 4, "avg_line_length": 42.2432432432, "max_line_length": 81, "alphanum_fraction": 0.7511196417}
@; -*- mode:scribble; coding: utf-8 -*-

@subsection[:tag "rnrs.exceptions.6"]{Exceptions}

@define[Library]{@name{(rnrs exceptions (6))}}
@desc{This section describes exception-handling and exception-raising constructs
provided by the @code{(rnrs exceptions (6))}library.
}

@define[Function]{@name{with-exception-handler} @args{handler thunk}}
@desc{[R6RS] @var{Handler} must be a procedure and should accept one argument.
@var{Thunk} must be a procedure that accepts zero arguments. The
@code{with-exception-handler} procedure returns the results of invoking
@var{thunk}. When an exception is raised, @var{handler} will be invoked with
the exception.
}

@define[Macro]{@name{guard} @args{(variable cond-clause @dots{}) body}}
@desc{[R6RS] Each @var{cond-clause} is as in the specification of @code{cond}.
and @code{else} are the same as in the @code{(rnrs base (6))} library.

Evaluating a @code{guard} form evaluates @var{body} with an exception handler
that binds the raised object to @var{variable} and within the scope of that
binding evaluates the clauses as if they were the clauses of a @code{cond}
expression. If every @var{cond-clause}'s test evaluates to #f and there is
no @code{else} clause, then raise is re-invoked on the raised object.
}

@define[Function]{@name{raise} @args{obj}}
@desc{[R6RS] Raises a non-continuable exception by invoking the current exception
handler on @var{obj}.
}

@define[Function]{@name{raise-continuable} @args{obj}}
@desc{[R6RS] Raises a continuable exception by invoking the current exception
handler on @var{obj}.
}