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


View this message in rfc822 format

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 44205 <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>
Subject: bug#44205: [PATCH] Add new function seq-remove-item
Date: Tue, 27 Oct 2020 13:36:07 +0000
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> 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)
>>
>> I find it a whole lot nicer than:
>>
>>     (seq-remove (lambda (a) (= a 2)) '(1 2 3))  => (1 3)
>
> Isn't this just
>
> (remove 2 '(1 2 3)) => (1 3)
>
> though?  I don't think seq.el needs to replicate the basic list
> functions...

I think the idea is that seq.el functions are generic and can thus be
extended to work with e.g. streams[1].

[1]: http://elpa.gnu.org/packages/stream.html

-- 
Basil




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.