aboutsummaryrefslogtreecommitdiffstats
path: root/lispref
diff options
context:
space:
mode:
authorRichard M. Stallman2002-01-11 01:05:49 +0000
committerRichard M. Stallman2002-01-11 01:05:49 +0000
commit65500a82e5b128fad3e7f9ca3bb10f483aba8e43 (patch)
tree0f888cd64fc9075ff142832223d8cb210ab2e7ea /lispref
parentdf9d055ed4e48ecca34927e2479d1284c964c57a (diff)
downloademacs-65500a82e5b128fad3e7f9ca3bb10f483aba8e43.tar.gz
emacs-65500a82e5b128fad3e7f9ca3bb10f483aba8e43.zip
Fix the double-property examples. Include one with a bare lambda.
Diffstat (limited to 'lispref')
-rw-r--r--lispref/functions.texi14
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:
858@example 858@example
859@group 859@group
860(defun double-property (symbol prop) 860(defun double-property (symbol prop)
861 (change-property symbol prop (lambda (x) (* 2 x)))) 861 (change-property symbol prop '(lambda (x) (* 2 x))))
862@end group 862@end group
863@end example 863@end example
864 864
@@ -892,6 +892,18 @@ do with the list. Perhaps it will check whether the @sc{car} of the third
892element is the symbol @code{*}! Using @code{function} tells the 892element is the symbol @code{*}! Using @code{function} tells the
893compiler it is safe to go ahead and compile the constant function. 893compiler it is safe to go ahead and compile the constant function.
894 894
895 Nowadays it is possible to omit @code{function} entirely, like this:
896
897@example
898@group
899(defun double-property (symbol prop)
900 (change-property symbol prop (lambda (x) (* 2 x))))
901@end group
902@end example
903
904@noindent
905This is because @code{lambda} itself implies @code{function}.
906
895 We sometimes write @code{function} instead of @code{quote} when 907 We sometimes write @code{function} instead of @code{quote} when
896quoting the name of a function, but this usage is just a sort of 908quoting the name of a function, but this usage is just a sort of
897comment: 909comment: