/[emacs]/emacs/lispref/functions.texi
ViewVC logotype

Diff of /emacs/lispref/functions.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by rms, Thu Sep 6 19:50:20 2001 UTC revision 1.17.4.1 by rms, Sun Jan 13 21:52:44 2002 UTC
# Line 811  anonymous function.  Such a list is vali Line 811  anonymous function.  Such a list is vali
811    
812  @smallexample  @smallexample
813  @group  @group
814  (setq silly (append (lambda (x)) (list (list '+ (* 3 4) 'x))))  (setq silly (append '(lambda (x)) (list (list '+ (* 3 4) 'x))))
815  @result{} (lambda (x) (+ 12 x))  @result{} (lambda (x) (+ 12 x))
816  @end group  @end group
817  @end smallexample  @end smallexample
# Line 858  passing it a function to double a number Line 858  passing it a function to double a number
858  @example  @example
859  @group  @group
860  (defun double-property (symbol prop)  (defun double-property (symbol prop)
861    (change-property symbol prop (lambda (x) (* 2 x))))    (change-property symbol prop '(lambda (x) (* 2 x))))
862  @end group  @end group
863  @end example  @end example
864    
# Line 892  do with the list.  Perhaps it will check Line 892  do with the list.  Perhaps it will check
892  element is the symbol @code{*}!  Using @code{function} tells the  element is the symbol @code{*}!  Using @code{function} tells the
893  compiler it is safe to go ahead and compile the constant function.  compiler it is safe to go ahead and compile the constant function.
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
905    This is because @code{lambda} itself implies @code{function}.
906    
907    We sometimes write @code{function} instead of @code{quote} when    We sometimes write @code{function} instead of @code{quote} when
908  quoting the name of a function, but this usage is just a sort of  quoting the name of a function, but this usage is just a sort of
909  comment:  comment:

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.17.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26