[Top][All Lists]

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

RE: master a6b5985: Avoid duplicated character classes in rx

From: Drew Adams
Subject: RE: master a6b5985: Avoid duplicated character classes in rx
Date: Tue, 3 Dec 2019 09:39:50 -0800 (PST)

> > I'd rather fix the code not to rely on the return value.
> I'm sure a lot more code relies on the return value of 'push'.
> It's also well-defined in Common Lisp. Why not just document it?


My guess is that this doc lack might have just
been an oversight.

Prior to Emacs 21 (or possibly 22), `push' was
defined only in `cl.el' (with no `cl-' prefix).

Its doc string said this:

  push is a Lisp macro in `cl.el'.
  (push X PLACE)

  (push X PLACE): insert X at the head of the list stored in PLACE.
  Analogous to (setf PLACE (cons X PLACE)), though more careful about
  evaluating each argument only once and in the right order.  PLACE may
  be a symbol, or any generalized variable allowed by `setf'.

IOW, even though that version of `push' was
supposed to be an Emacs emulation of Common
Lisp `push', there's no mention of the return
value.  There should have been.

`push' was moved outside of `cl.el' in Emacs 22
(or 21 possibly).  Its doc string was not fixed
to specify the return value.

`cl-pushnew' has the same doc problem: no spec
of the return value.

We should specify the return value for each of
these.  It is as important to `push' as it is
to `pop' (whose doc does specify the return

Common Lisp specifies the return value:


reply via email to

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