GNU bug report logs - #44205
[PATCH] Add new function seq-remove-item

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Sun, 25 Oct 2020 00:53:01 UTC

Severity: normal

Tags: patch, wontfix

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


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

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 44205 <at> debbugs.gnu.org
Subject: Re: bug#44205: [PATCH] Add new function seq-remove-item
Date: Sun, 25 Oct 2020 21:12:46 +0200
> I found myself reaching for a version of `seq-remove' where I don't have
> to supply a lambda but can just give an item.  Ergo, the attached.
>
>     (seq-remove-item 2 '(1 2 3))  => (1 3)

There is no name 'item' used in function names of seq.el.  The term used
here is 'elt', so maybe 'seq-remove-elt' would be a better name.

> I find it a whole lot nicer than:
>
>     (seq-remove (lambda (a) (= a 2)) '(1 2 3))  => (1 3)
>
> Turns out it could already be used to simplify some code in tab-line.el,
> even if seq is arguably not yet very widely used in our sources.

The initial versions of tab-line.el used a more complex condition,
but now a simpler remove/remq could be used instead.




This bug report was last modified 4 years and 186 days ago.

Previous Next


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