[Top][All Lists]

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

Re: Quoted lambda expressions in manuals

From: Luc Teirlinck
Subject: Re: Quoted lambda expressions in manuals
Date: Sat, 17 Dec 2005 13:10:11 -0600 (CST)

Ralf Angeli wrote:

   There are some quoted lambda expressions in the manuals:

   find . -type f -print0 | xargs -0 -e grep -nH -e "'(lambda"
   ./custom.texi:905:  '(lambda ()
   ./custom.texi:1392:          '(lambda ()
   ./custom.texi:2222:  '(lambda () (auto-fill-mode 1)))
   ./emacs-xtra.texi:215:     #'(lambda (&optional noconfirm) 'fast))
   ./gnus.texi:3020:  '(lambda nil (local-set-key "d" (local-key-binding "n"))))

   Maybe those could be removed eventually in order to prevent bad karma
   (as Stefan puts it).

There is a difference between ' and #'.  According to the Elisp
manual, quoting a lambda expression with ' can be used to prevent
byte-compilation.  (If this is incorrect, the Elisp manual should be
corrected.)  Preventing byte-compilation is clearly not intended
in the above examples.

In as far as #' is concerned, `(elisp)Anonymous Functions' points out
that it is no longer really necessary, but goes on to discuss it at
length, and examples in other nodes in the Elisp manual use it.  The
clear impression you get from reading the Elisp doc is that, although
#' (or `function') is not necessary, it is better to use it anyway, as
a sort of comment.  _If_ this is wrong and if the special form
`function' is actually deprecated, then several changes in the Elisp
manual would be needed.  In that case, the discussion of `function' in
`(elisp)Anonymous Functions' should be substantially shortened.  It
should explicitly state that `function' should only be used if you
want your code to work with old Emacs versions.  `function' should not
be used in examples in the Elisp manual.

The main question is:

Is the special form `function' (or #') deprecated or is its use as a
type of comment still encouraged, as the Elisp manual seems to suggest?
Or is it only deprecated for lambda expressions and not for quoting
symbols that are used as functions (where most of the time a simple '
appears to be used in practice anyway)?



reply via email to

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