Mercurial > hg > xemacs-beta
comparison man/lispref/eval.texi @ 444:576fb035e263 r21-2-37
Import from CVS: tag r21-2-37
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:36:19 +0200 |
parents | 3ecd8885ac67 |
children | c33ae14dd6d0 |
comparison
equal
deleted
inserted
replaced
443:a8296e22da4e | 444:576fb035e263 |
---|---|
1 @c -*-texinfo-*- | 1 @c -*-texinfo-*- |
2 @c This is part of the XEmacs Lisp Reference Manual. | 2 @c This is part of the XEmacs Lisp Reference Manual. |
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. | 3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. |
4 @c See the file lispref.texi for copying conditions. | 4 @c See the file lispref.texi for copying conditions. |
5 @setfilename ../../info/eval.info | 5 @setfilename ../../info/eval.info |
6 @node Evaluation, Control Structures, Symbols, Top | 6 @node Evaluation, Control Structures, Symbols, Top |
7 @chapter Evaluation | 7 @chapter Evaluation |
8 @cindex evaluation | 8 @cindex evaluation |
28 | 28 |
29 @node Intro Eval | 29 @node Intro Eval |
30 @section Introduction to Evaluation | 30 @section Introduction to Evaluation |
31 | 31 |
32 The Lisp interpreter, or evaluator, is the program that computes | 32 The Lisp interpreter, or evaluator, is the program that computes |
33 the value of an expression that is given to it. When a function | 33 the value of an expression that is given to it. When a function |
34 written in Lisp is called, the evaluator computes the value of the | 34 written in Lisp is called, the evaluator computes the value of the |
35 function by evaluating the expressions in the function body. Thus, | 35 function by evaluating the expressions in the function body. Thus, |
36 running any Lisp program really means running the Lisp interpreter. | 36 running any Lisp program really means running the Lisp interpreter. |
37 | 37 |
38 How the evaluator handles an object depends primarily on the data | 38 How the evaluator handles an object depends primarily on the data |
431 function, not a symbol. | 431 function, not a symbol. |
432 | 432 |
433 @smallexample | 433 @smallexample |
434 @group | 434 @group |
435 ((lambda (arg) (erste arg)) | 435 ((lambda (arg) (erste arg)) |
436 '(1 2 3)) | 436 '(1 2 3)) |
437 @result{} 1 | 437 @result{} 1 |
438 @end group | 438 @end group |
439 @end smallexample | 439 @end smallexample |
440 | 440 |
441 @noindent | 441 @noindent |
443 symbol function indirection when calling @code{erste}. | 443 symbol function indirection when calling @code{erste}. |
444 | 444 |
445 The built-in function @code{indirect-function} provides an easy way to | 445 The built-in function @code{indirect-function} provides an easy way to |
446 perform symbol function indirection explicitly. | 446 perform symbol function indirection explicitly. |
447 | 447 |
448 @c Emacs 19 feature | 448 @defun indirect-function object |
449 @defun indirect-function function | 449 This function returns the meaning of @var{object} as a function. If |
450 This function returns the meaning of @var{function} as a function. If | 450 @var{object} is a symbol, then it finds @var{object}'s function |
451 @var{function} is a symbol, then it finds @var{function}'s function | 451 definition and starts over with that value. If @var{object} is not a |
452 definition and starts over with that value. If @var{function} is not a | 452 symbol, then it returns @var{object} itself. |
453 symbol, then it returns @var{function} itself. | |
454 | 453 |
455 Here is how you could define @code{indirect-function} in Lisp: | 454 Here is how you could define @code{indirect-function} in Lisp: |
456 | 455 |
457 @smallexample | 456 @smallexample |
458 (defun indirect-function (function) | 457 (defun indirect-function (function) |