bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

elisp manual documentation of the `function' special form is outdated


From: Alefnull Petrofsky
Subject: elisp manual documentation of the `function' special form is outdated
Date: Tue, 8 Jan 2002 17:07:02 -0800

Two of the examples in the Anonymous Functions node are missing
quotes:

     (setq silly (append (lambda (x)) (list (list '+ (* 3 4) 'x))))

should be

     (setq silly (append '(lambda (x)) (list (list '+ (* 3 4) 'x))))

Otherwise it will not work if compiled.  

Later, the text reads:

  Here we define a function that uses `change-property', passing it a
  function to double a number:

       (defun double-property (symbol prop)
         (change-property symbol prop (lambda (x) (* 2 x))))

  In such cases, we usually use the special form `function' instead of
  simple quotation to quote the anonymous function, ...

But that double-property defun we just passed did not use simple
quotation, it used the lambda form as an expression.

The whole treatment of "function" seems to be a relic from the time
when the only choices were (function (lambda ...)) and (quote (lambda
...)).  It should be mentioned that today one can use just plain
(lambda ...) and get both brevity and compilability.

-al



reply via email to

[Prev in Thread] Current Thread [Next in Thread]