From: Richard M. Stallman Date: Sun, 13 Jan 2002 21:52:44 +0000 (+0000) Subject: Restore the quote in the `silly' example. X-Git-Tag: emacs-21.2~192 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a43aed0a5a1b43348726eec862c6f94ef47c9e11;p=emacs.git Restore the quote in the `silly' example. Fix the double-property examples. Include one with a bare lambda. --- diff --git a/lispref/functions.texi b/lispref/functions.texi index 9f684593a98..67d68e40a9a 100644 --- a/lispref/functions.texi +++ b/lispref/functions.texi @@ -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: