diff options
Diffstat (limited to 'doc/ref')
-rw-r--r-- | doc/ref/api-control.texi | 19 | ||||
-rw-r--r-- | doc/ref/api-debug.texi | 14 |
2 files changed, 25 insertions, 8 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 diff --git a/doc/ref/api-debug.texi b/doc/ref/api-debug.texi index cf9ea5aca..c5fbe5629 100644 --- a/doc/ref/api-debug.texi +++ b/doc/ref/api-debug.texi @@ -238,11 +238,11 @@ that, if an error occurs when evaluating the transformed expression, Guile's debugger can point back to the file and location where the expression originated. -The way that source properties are stored means that Guile can only -associate source properties with parenthesized expressions, and not, for -example, with individual symbols, numbers or strings. The difference -can be seen by typing @code{(xxx)} and @code{xxx} at the Guile prompt -(where the variable @code{xxx} has not been defined): +The way that source properties are stored means that Guile cannot +associate source properties with individual numbers, symbols, +characters, booleans, or keywords. This can be seen by typing +@code{(xxx)} and @code{xxx} at the Guile prompt (where the variable +@code{xxx} has not been defined): @example scheme@@(guile-user)> (xxx) @@ -288,8 +288,8 @@ Return the property specified by @var{key} from @var{obj}'s source properties. @end deffn -If the @code{positions} reader option is enabled, each parenthesized -expression will have values set for the @code{filename}, @code{line} and +If the @code{positions} reader option is enabled, supported expressions +will have values set for the @code{filename}, @code{line} and @code{column} properties. Source properties are also associated with syntax objects. Procedural |