272 |
want to use exceptions (@pxref{Exceptions}) instead. |
want to use exceptions (@pxref{Exceptions}) instead. |
273 |
|
|
274 |
@rnindex call-with-current-continuation |
@rnindex call-with-current-continuation |
275 |
@deffn primitive call-with-current-continuation proc |
@deffn {Scheme Procedure} call-with-current-continuation proc |
276 |
Capture the current continuation and call @var{proc} with the captured |
Capture the current continuation and call @var{proc} with the captured |
277 |
continuation as the single argument. This continuation can then be |
continuation as the single argument. This continuation can then be |
278 |
called with arbitrarily many arguments. Such a call will work like a |
called with arbitrarily many arguments. Such a call will work like a |
324 |
parameters. |
parameters. |
325 |
|
|
326 |
@rnindex values |
@rnindex values |
327 |
@deffn primitive values expr @dots{} |
@deffn {Scheme Procedure} values . args |
328 |
|
@deffnx {C Function} scm_values (args) |
329 |
Delivers all of its arguments to its continuation. Except for |
Delivers all of its arguments to its continuation. Except for |
330 |
continuations created by the @code{call-with-values} procedure, |
continuations created by the @code{call-with-values} procedure, |
331 |
all continuations take exactly one value. The effect of |
all continuations take exactly one value. The effect of |
334 |
@end deffn |
@end deffn |
335 |
|
|
336 |
@rnindex call-with-values |
@rnindex call-with-values |
337 |
@deffn primitive call-with-values producer consumer |
@deffn {Scheme Procedure} call-with-values producer consumer |
338 |
Calls its @var{producer} argument with no values and a |
Calls its @var{producer} argument with no values and a |
339 |
continuation that, when passed some values, calls the |
continuation that, when passed some values, calls the |
340 |
@var{consumer} procedure with those values as arguments. The |
@var{consumer} procedure with those values as arguments. The |
490 |
corresponds to the number of arguments in all @code{throw} expressions |
corresponds to the number of arguments in all @code{throw} expressions |
491 |
that can be caught by this @code{catch}. |
that can be caught by this @code{catch}. |
492 |
|
|
493 |
@deffn primitive catch key thunk handler |
@deffn {Scheme Procedure} catch key thunk handler |
494 |
|
@deffnx {C Function} scm_catch (key, thunk, handler) |
495 |
Invoke @var{thunk} in the dynamic context of @var{handler} for |
Invoke @var{thunk} in the dynamic context of @var{handler} for |
496 |
exceptions matching @var{key}. If thunk throws to the symbol |
exceptions matching @var{key}. If thunk throws to the symbol |
497 |
@var{key}, then @var{handler} is invoked this way: |
@var{key}, then @var{handler} is invoked this way: |
546 |
of exception should specify the additional arguments that are expected |
of exception should specify the additional arguments that are expected |
547 |
for that kind of exception. |
for that kind of exception. |
548 |
|
|
549 |
@deffn primitive throw key . args |
@deffn {Scheme Procedure} throw key . args |
550 |
|
@deffnx {C Function} scm_throw (key, args) |
551 |
Invoke the catch form matching @var{key}, passing @var{args} to the |
Invoke the catch form matching @var{key}, passing @var{args} to the |
552 |
@var{handler}. |
@var{handler}. |
553 |
|
|
609 |
unwinding the call stack from the context of the @code{throw} expression |
unwinding the call stack from the context of the @code{throw} expression |
610 |
that caused the handler to be invoked. |
that caused the handler to be invoked. |
611 |
|
|
612 |
@deffn primitive lazy-catch key thunk handler |
@deffn {Scheme Procedure} lazy-catch key thunk handler |
613 |
|
@deffnx {C Function} scm_lazy_catch (key, thunk, handler) |
614 |
This behaves exactly like @code{catch}, except that it does |
This behaves exactly like @code{catch}, except that it does |
615 |
not unwind the stack before invoking @var{handler}. |
not unwind the stack before invoking @var{handler}. |
616 |
The @var{handler} procedure is not allowed to return: |
The @var{handler} procedure is not allowed to return: |
731 |
conditions that are implemented on top of the exception primitives just |
conditions that are implemented on top of the exception primitives just |
732 |
described. |
described. |
733 |
|
|
734 |
@deffn procedure error msg args @dots{} |
@deffn {Scheme Procedure} error msg args @dots{} |
735 |
Raise an error with key @code{misc-error} and a message constructed by |
Raise an error with key @code{misc-error} and a message constructed by |
736 |
displaying @var{msg} and writing @var{args}. |
displaying @var{msg} and writing @var{args}. |
737 |
@end deffn |
@end deffn |
738 |
|
|
739 |
@deffn primitive scm-error key subr message args data |
@deffn {Scheme Procedure} scm-error key subr message args data |
740 |
|
@deffnx {C Function} scm_error_scm (key, subr, message, args, data) |
741 |
Raise an error with key @var{key}. @var{subr} can be a string |
Raise an error with key @var{key}. @var{subr} can be a string |
742 |
naming the procedure associated with the error, or @code{#f}. |
naming the procedure associated with the error, or @code{#f}. |
743 |
@var{message} is the error message string, possibly containing |
@var{message} is the error message string, possibly containing |
753 |
it will usually be @code{#f}. |
it will usually be @code{#f}. |
754 |
@end deffn |
@end deffn |
755 |
|
|
756 |
@deffn primitive strerror err |
@deffn {Scheme Procedure} strerror err |
757 |
|
@deffnx {C Function} scm_strerror (err) |
758 |
Return the Unix error message corresponding to @var{err}, which |
Return the Unix error message corresponding to @var{err}, which |
759 |
must be an integer value. |
must be an integer value. |
760 |
@end deffn |
@end deffn |
774 |
be reviewed] |
be reviewed] |
775 |
|
|
776 |
@rnindex dynamic-wind |
@rnindex dynamic-wind |
777 |
@deffn primitive dynamic-wind in_guard thunk out_guard |
@deffn {Scheme Procedure} dynamic-wind in_guard thunk out_guard |
778 |
|
@deffnx {C Function} scm_dynamic_wind (in_guard, thunk, out_guard) |
779 |
All three arguments must be 0-argument procedures. |
All three arguments must be 0-argument procedures. |
780 |
@var{in_guard} is called, then @var{thunk}, then |
@var{in_guard} is called, then @var{thunk}, then |
781 |
@var{out_guard}. |
@var{out_guard}. |