]> git.eshelyaron.com Git - emacs.git/commitdiff
Restore the quote in the `silly' example.
authorRichard M. Stallman <rms@gnu.org>
Sun, 13 Jan 2002 21:52:44 +0000 (21:52 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 13 Jan 2002 21:52:44 +0000 (21:52 +0000)
Fix the double-property examples.  Include one with a bare lambda.

lispref/functions.texi

index 9f684593a9859d4a83072d3329c6d67629bd60c5..67d68e40a9affa9684541b22a0a04aed5522d833 100644 (file)
@@ -811,7 +811,7 @@ anonymous function.  Such a list is valid wherever a function name is.
 
 @smallexample
 @group
-(setq silly (append (lambda (x)) (list (list '+ (* 3 4) 'x))))
+(setq silly (append '(lambda (x)) (list (list '+ (* 3 4) 'x))))
 @result{} (lambda (x) (+ 12 x))
 @end group
 @end smallexample
@@ -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: