/[guile]/guile/guile-core/doc/ref/scheme-control.texi
ViewVC logotype

Diff of /guile/guile-core/doc/ref/scheme-control.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.2 by ttn, Tue Jan 8 09:22:36 2002 UTC revision 1.1.2.3 by ossau, Fri Mar 15 09:23:18 2002 UTC
# Line 272  for escape procedures and your program i Line 272  for escape procedures and your program i
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
# Line 324  multiple values with a procedure which a Line 324  multiple values with a procedure which 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
# Line 333  were not created by @code{call-with-valu Line 334  were not created by @code{call-with-valu
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
# Line 489  procedure must be designed to accept a n Line 490  procedure must be designed to accept a n
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:
# Line 544  depends on the exception type.  The docu Line 546  depends on the exception type.  The docu
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    
# Line 606  one important respect: the handler proce Line 609  one important respect: the handler proce
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:
# Line 727  Guile provides a set of convenience proc Line 731  Guile provides a set of convenience proc
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
# Line 748  should be a list containing the Unix sig Line 753  should be a list containing the Unix sig
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
# Line 768  if an exception occurs then @code{#f} is Line 774  if an exception occurs then @code{#f} is
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}.

Legend:
Removed from v.1.1.2.2  
changed lines
  Added in v.1.1.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26