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 |
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 |
|
|
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: |