GNU bug report logs - #33998
27.0.50; cl-delete does not delete the first list element

Previous Next

Package: emacs;

Reported by: Deus Max <deusmax <at> gmx.com>

Date: Sun, 6 Jan 2019 17:48:01 UTC

Severity: minor

Tags: notabug

Found in version 27.0.50

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #35 received at 33998 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 33998 <at> debbugs.gnu.org, Deus Max <deusmax <at> gmx.com>
Subject: Re: bug#33998: 27.0.50;
 cl-delete does not delete the first list element
Date: Tue, 8 Jan 2019 13:45:19 +0000
On Mon, Jan 7, 2019 at 6:14 PM Drew Adams <drew.adams <at> oracle.com> wrote:
>
> > > > So, cumbersome as it is, you should always use:
> > >                                ^^^^^^^^^^^^^
> > > > (setq seq (cl-delete thing seq))
> > >
> > > FWIW, this is not really true.
> > >
> > > `cl-delete' deletes THING from the
> > > _value_ of SEQ.  You might or you
> > > might not want variable SEQ to have
> > > the updated value.
> >
> > But this is what he wanted, so what's
> > the point in making this more confusing
> > than it needs to be?
>
> It's enough to suggest that he might want
> to do that, and point to the manual for
> explanation.  It's the "always" that's
> misleading.

Actually, as I've subsequently demonstrated
the leeway given to cl-delete by the CL spec
is such that it is quite a good idea to *always*
use the (setq SEQ (cl-delete THING SEQ)) idiom,
because you have no control on what cl-delete
does with SEQ. You might indeed not want it
changed but it may change, and not in ways
you can predict.

João




This bug report was last modified 6 years and 129 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.