summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2005-12-06 21:32:55 +0000
committerMarius Vollmer <mvo@zagadka.de>2005-12-06 21:32:55 +0000
commit43ed3b697ec519a9d7342fa79b04e0ba08b5f7e2 (patch)
tree7efb109dd2013daa64fd1da26e31504b9fd5e211
parente5547d5fc877c004bce9e25194f3b59db3489e97 (diff)
downloadguile-43ed3b697ec519a9d7342fa79b04e0ba08b5f7e2.tar.gz
* api-control.texi (if cond case): Describe SRFI 61 cond.
* srfi-modules.texi (SRFI-61): New section. (SRFI Support): Add SRFI-61 to menu.
-rw-r--r--doc/ref/api-control.texi20
-rw-r--r--doc/ref/srfi-modules.texi11
2 files changed, 31 insertions, 0 deletions
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: