diff options
| author | Joakim Verona | 2012-01-23 15:10:06 +0100 |
|---|---|---|
| committer | Joakim Verona | 2012-01-23 15:10:06 +0100 |
| commit | 0322b140eead7c94de7f0f6d19a90bd15690b4eb (patch) | |
| tree | 950c011783cc896d0450084cb5155e54548bfe5b /doc/lispref/eval.texi | |
| parent | d5114bfea3ea4c37c57e2af0f3b095be9fcd8bac (diff) | |
| parent | cb5850f27c1b4d26957d58e2da2314dd12498671 (diff) | |
| download | emacs-0322b140eead7c94de7f0f6d19a90bd15690b4eb.tar.gz emacs-0322b140eead7c94de7f0f6d19a90bd15690b4eb.zip | |
upstream
Diffstat (limited to 'doc/lispref/eval.texi')
| -rw-r--r-- | doc/lispref/eval.texi | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/doc/lispref/eval.texi b/doc/lispref/eval.texi index adb4841a82d..fc18e503543 100644 --- a/doc/lispref/eval.texi +++ b/doc/lispref/eval.texi | |||
| @@ -64,8 +64,8 @@ evaluate a @dfn{function call} form such as @code{(car x)}, Emacs | |||
| 64 | first evaluates the argument (the subform @code{x}). After evaluating | 64 | first evaluates the argument (the subform @code{x}). After evaluating |
| 65 | the argument, Emacs @dfn{executes} the function (@code{car}), and if | 65 | the argument, Emacs @dfn{executes} the function (@code{car}), and if |
| 66 | the function is written in Lisp, execution works by evaluating the | 66 | the function is written in Lisp, execution works by evaluating the |
| 67 | @dfn{body} of the function. (In this example, however, @code{car} is | 67 | @dfn{body} of the function (in this example, however, @code{car} is |
| 68 | not a Lisp function; it is a primitive function implemented in C.) | 68 | not a Lisp function; it is a primitive function implemented in C). |
| 69 | @xref{Functions}, for more information about functions and function | 69 | @xref{Functions}, for more information about functions and function |
| 70 | calls. | 70 | calls. |
| 71 | 71 | ||
| @@ -77,9 +77,8 @@ variables (@pxref{Variables}).@footnote{This definition of | |||
| 77 | that can affect the result of a program.} Whenever a form refers to a | 77 | that can affect the result of a program.} Whenever a form refers to a |
| 78 | variable without creating a new binding for it, the variable evaluates | 78 | variable without creating a new binding for it, the variable evaluates |
| 79 | to the value given by the current environment. Evaluating a form may | 79 | to the value given by the current environment. Evaluating a form may |
| 80 | create a new environment for recursive evaluation, by binding | 80 | also temporarily alter the environment by binding variables |
| 81 | variables (@pxref{Local Variables}). Such environments are temporary, | 81 | (@pxref{Local Variables}). |
| 82 | and vanish when the evaluation of the form is complete. | ||
| 83 | 82 | ||
| 84 | @cindex side effect | 83 | @cindex side effect |
| 85 | Evaluating a form may also make changes that persist; these changes | 84 | Evaluating a form may also make changes that persist; these changes |
| @@ -177,9 +176,9 @@ program. Here is an example: | |||
| 177 | @cindex symbol evaluation | 176 | @cindex symbol evaluation |
| 178 | 177 | ||
| 179 | When a symbol is evaluated, it is treated as a variable. The result | 178 | When a symbol is evaluated, it is treated as a variable. The result |
| 180 | is the variable's value, if it has one. If it has none (if its value | 179 | is the variable's value, if it has one. If the symbol has no value as |
| 181 | cell is void), an error is signaled. For more information on the use of | 180 | a variable, the Lisp interpreter signals an error. For more |
| 182 | variables, see @ref{Variables}. | 181 | information on the use of variables, see @ref{Variables}. |
| 183 | 182 | ||
| 184 | In the following example, we set the value of a symbol with | 183 | In the following example, we set the value of a symbol with |
| 185 | @code{setq}. Then we evaluate the symbol, and get back the value that | 184 | @code{setq}. Then we evaluate the symbol, and get back the value that |
| @@ -602,12 +601,13 @@ functions provides the ability to pass information to them as | |||
| 602 | arguments. | 601 | arguments. |
| 603 | 602 | ||
| 604 | @defun eval form &optional lexical | 603 | @defun eval form &optional lexical |
| 605 | This is the basic function evaluating an expression. It evaluates | 604 | This is the basic function for evaluating an expression. It evaluates |
| 606 | @var{form} in the current environment and returns the result. How the | 605 | @var{form} in the current environment and returns the result. How the |
| 607 | evaluation proceeds depends on the type of the object (@pxref{Forms}). | 606 | evaluation proceeds depends on the type of the object (@pxref{Forms}). |
| 608 | @var{lexical} if non-nil means to evaluate @var{form} using lexical scoping | 607 | |
| 609 | rules (@pxref{Lexical Binding}) instead of the default dynamic scoping used | 608 | The argument @var{lexical}, if non-@code{nil}, means to evaluate |
| 610 | historically in Emacs Lisp. | 609 | @var{form} using lexical scoping rules for variables, instead of the |
| 610 | default dynamic scoping rules. @xref{Lexical Binding}. | ||
| 611 | 611 | ||
| 612 | Since @code{eval} is a function, the argument expression that appears | 612 | Since @code{eval} is a function, the argument expression that appears |
| 613 | in a call to @code{eval} is evaluated twice: once as preparation before | 613 | in a call to @code{eval} is evaluated twice: once as preparation before |