diff options
author | Andy Wingo <wingo@pobox.com> | 2012-02-11 18:14:48 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2012-02-11 18:14:48 +0100 |
commit | a41bed83ab2d2f0bf93c06115c695280d04d13e6 (patch) | |
tree | fe300b182a0e4e3fb411cfb67bc2ed05313a11c8 /doc/ref/api-control.texi | |
parent | bbabae997d7e83e0382d086ce2e0ed82b61c2a7e (diff) | |
parent | c2c3bddb1d0b2180282d78262e84c3ae7a44731f (diff) | |
download | guile-a41bed83ab2d2f0bf93c06115c695280d04d13e6.tar.gz |
Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
libguile/read.c
test-suite/tests/tree-il.test
Diffstat (limited to 'doc/ref/api-control.texi')
-rw-r--r-- | doc/ref/api-control.texi | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/doc/ref/api-control.texi b/doc/ref/api-control.texi index fc5935070..ca7ad4af6 100644 --- a/doc/ref/api-control.texi +++ b/doc/ref/api-control.texi @@ -212,18 +212,30 @@ result of the @code{cond}-expression. @end deffn @deffn syntax case key clause1 clause2 @dots{} -@var{key} may be any expression, the @var{clause}s must have the form +@var{key} may be any expression, and the @var{clause}s must have the form @lisp ((@var{datum1} @dots{}) @var{expr1} @var{expr2} @dots{}) @end lisp +or + +@lisp +((@var{datum1} @dots{}) => @var{expression}) +@end lisp + and the last @var{clause} may have the form @lisp (else @var{expr1} @var{expr2} @dots{}) @end lisp +or + +@lisp +(else => @var{expression}) +@end lisp + All @var{datum}s must be distinct. First, @var{key} is evaluated. The result of this evaluation is compared against all @var{datum} values using @code{eqv?}. When this comparison succeeds, the expression(s) following @@ -234,6 +246,11 @@ If the @var{key} matches no @var{datum} and there is an @code{else}-clause, the expressions following the @code{else} are evaluated. If there is no such clause, the result of the expression is unspecified. + +For the @code{=>} clause types, @var{expression} is evaluated and the +resulting procedure is applied to the value of @var{key}. The result of +this procedure application is then the result of the +@code{case}-expression. @end deffn |