diff options
| author | Glenn Morris | 2013-12-27 16:47:15 -0800 |
|---|---|---|
| committer | Glenn Morris | 2013-12-27 16:47:15 -0800 |
| commit | c04d52fbc95fd8f5b44a391f1ce5b8224fcd55d8 (patch) | |
| tree | ffa10ef3aaa6367ef3d0bead4b9d5e48b5a46876 | |
| parent | ad15bd74e4639fcf768498276bf1bafffa128577 (diff) | |
| download | emacs-c04d52fbc95fd8f5b44a391f1ce5b8224fcd55d8.tar.gz emacs-c04d52fbc95fd8f5b44a391f1ce5b8224fcd55d8.zip | |
* doc/lispref/control.texi (Pattern matching case statement): Brevity.
| -rw-r--r-- | doc/lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/control.texi | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index c4fdfb18a9b..b86ab722764 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-12-28 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * control.texi (Pattern matching case statement): Brevity. | ||
| 4 | |||
| 1 | 2013-12-27 Chong Yidong <cyd@gnu.org> | 5 | 2013-12-27 Chong Yidong <cyd@gnu.org> |
| 2 | 6 | ||
| 3 | * functions.texi (Function Cells): | 7 | * functions.texi (Function Cells): |
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index f5cdd3dc80f..5bd2d7acdbe 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi | |||
| @@ -322,7 +322,8 @@ In the last clause, @code{code} is a variable that gets bound to the value that | |||
| 322 | was returned by @code{(get-return-code x)}. | 322 | was returned by @code{(get-return-code x)}. |
| 323 | 323 | ||
| 324 | To give a more complex example, a simple interpreter for a little | 324 | To give a more complex example, a simple interpreter for a little |
| 325 | expression language could look like: | 325 | expression language could look like (note that this example requires |
| 326 | lexical-binding): | ||
| 326 | 327 | ||
| 327 | @example | 328 | @example |
| 328 | (defun evaluate (exp env) | 329 | (defun evaluate (exp env) |
| @@ -342,11 +343,6 @@ third elements and binds them to the variables @code{x} and @code{y}. | |||
| 342 | @code{(pred numberp)} is a pattern that simply checks that @code{exp} | 343 | @code{(pred numberp)} is a pattern that simply checks that @code{exp} |
| 343 | is a number, and @code{_} is the catch-all pattern that matches anything. | 344 | is a number, and @code{_} is the catch-all pattern that matches anything. |
| 344 | 345 | ||
| 345 | Note that the the lambda being the result of the @code{fn} clause is a | ||
| 346 | closure (@pxref{Closures}), so the file defining @code{evaluate} must | ||
| 347 | have lexical binding enabled (@pxref{Using Lexical Binding}, for how | ||
| 348 | to enable it). | ||
| 349 | |||
| 350 | Here are some sample programs including their evaluation results: | 346 | Here are some sample programs including their evaluation results: |
| 351 | 347 | ||
| 352 | @example | 348 | @example |