all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Stefan Kangas <stefan@marxist.se>
Cc: 44205@debbugs.gnu.org
Subject: bug#44205: [PATCH] Add new function seq-remove-item
Date: Sun, 25 Oct 2020 21:12:46 +0200	[thread overview]
Message-ID: <878sbuqho5.fsf@mail.linkov.net> (raw)
In-Reply-To: <CADwFkmnygDtrTEHqWVJ1watMswR8NPy_XAioa5rh8bKNyqbMeA@mail.gmail.com> (Stefan Kangas's message of "Sat, 24 Oct 2020 17:52:04 -0700")

> 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.





  parent reply	other threads:[~2020-10-25 19:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-25  0:52 bug#44205: [PATCH] Add new function seq-remove-item Stefan Kangas
2020-10-25 12:49 ` Lars Ingebrigtsen
2020-10-27 13:36   ` Basil L. Contovounesios
2020-11-13  0:07     ` Stefan Kangas
2020-11-18 17:17       ` Stefan Kangas
2020-10-25 16:25 ` Unknown
2020-10-25 19:12 ` Juri Linkov [this message]
2020-10-27 13:45 ` Basil L. Contovounesios

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878sbuqho5.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=44205@debbugs.gnu.org \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.