changeset 42647:3e0b4b8d4f7e

Fix the double-property examples. Include one with a bare lambda.
author Richard M. Stallman <rms@gnu.org>
date Fri, 11 Jan 2002 01:05:49 +0000
parents 8fd3ab944dc3
children 3c13c99d23ad
files lispref/functions.texi
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lispref/functions.texi	Thu Jan 10 22:14:26 2002 +0000
+++ b/lispref/functions.texi	Fri Jan 11 01:05:49 2002 +0000
@@ -858,7 +858,7 @@
 @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 @@
 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: