diff --git a/doc/ref/api-control.texi b/doc/ref/api-control.texi index f862b89cc..efdb4531e 100644 --- a/doc/ref/api-control.texi +++ b/doc/ref/api-control.texi @@ -108,6 +108,26 @@ the @code{cond}-expression. For the @code{=>} clause type, the value of @var{test}. The result of this procedure application is then the result of the @code{cond}-expression. +@cindex SRFI-61 +@cindex general cond clause +@cindex multiple values and cond +One additional @code{cond}-clause is available as an extension to +standard Scheme: + +@lisp +(@var{test} @var{guard} => @var{expression}) +@end lisp + +where @var{guard} and @var{expression} must evaluate to procedures. +For this clause type, @var{test} may return multiple values, and +@code{cond} ignores its boolean state; instead, @code{cond} evaluates +@var{guard} and applies the resulting procedure to the value(s) of +@var{test}, as if @var{guard} were the @var{consumer} argument of +@code{call-with-values}. Iff the result of that procedure call is a +true value, it evaluates @var{expression} and applies the resulting +procedure to the value(s) of @var{test}, in the same manner as the +@var{guard} was called. + The @var{test} of the last @var{clause} may be the symbol @code{else}. Then, if none of the preceding @var{test}s is true, the @var{expression}s following the @code{else} are evaluated to produce the diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi index 4bfa6cc88..3291320f3 100644 --- a/doc/ref/srfi-modules.texi +++ b/doc/ref/srfi-modules.texi @@ -40,6 +40,7 @@ get the relevant SRFI documents from the SRFI home page * SRFI-39:: Parameter objects * SRFI-55:: Requiring Features. * SRFI-60:: Integers as bits. +* SRFI-61:: A more general `cond' clause @end menu @@ -2685,6 +2686,16 @@ element becomes the most significant bit in the return. @end defun +@node SRFI-61 +@subsection SRFI-61 - A more general @code{cond} clause + +This SRFI extends RnRS @code{cond} to support test expressions that +return multiple values, as well as arbitrary definitions of test +success. SRFI 61 is implemented in the Guile core; there's no module +needed to get SRFI-61 itself. Extended @code{cond} is documented in +@ref{if cond case,, Simple Conditional Evaluation}. + + @c srfi-modules.texi ends here @c Local Variables: