diff options
author | Richard M. Stallman <rms@gnu.org> | 2002-01-11 01:05:49 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2002-01-11 01:05:49 +0000 |
commit | 65500a82e5b128fad3e7f9ca3bb10f483aba8e43 (patch) | |
tree | 0f888cd64fc9075ff142832223d8cb210ab2e7ea /lispref/functions.texi | |
parent | df9d055ed4e48ecca34927e2479d1284c964c57a (diff) | |
download | emacs-65500a82e5b128fad3e7f9ca3bb10f483aba8e43.tar.gz |
Fix the double-property examples. Include one with a bare lambda.
Diffstat (limited to 'lispref/functions.texi')
-rw-r--r-- | lispref/functions.texi | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lispref/functions.texi b/lispref/functions.texi index 9f684593a98..78e4a44327e 100644 --- a/lispref/functions.texi +++ b/lispref/functions.texi @@ -858,7 +858,7 @@ passing it a function to double a number: @example @group (defun double-property (symbol prop) - (change-property symbol prop (lambda (x) (* 2 x)))) + (change-property symbol prop '(lambda (x) (* 2 x)))) @end group @end example @@ -892,6 +892,18 @@ do with the list. Perhaps it will check whether the @sc{car} of the third element is the symbol @code{*}! Using @code{function} tells the compiler it is safe to go ahead and compile the constant function. + Nowadays it is possible to omit @code{function} entirely, like this: + +@example +@group +(defun double-property (symbol prop) + (change-property symbol prop (lambda (x) (* 2 x)))) +@end group +@end example + +@noindent +This is because @code{lambda} itself implies @code{function}. + We sometimes write @code{function} instead of @code{quote} when quoting the name of a function, but this usage is just a sort of comment: |