unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58278: Add new function seq-keep
@ 2022-10-03 21:30 Jonas Bernoulli
  2022-10-03 23:47 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 16+ messages in thread
From: Jonas Bernoulli @ 2022-10-03 21:30 UTC (permalink / raw)
  To: 58278

While I still appreciate the `dash' package, I try to avoid it in
a package when all or most of its used `dash' functions and macros,
can be replaced with equivalent functions/macros from `seq', `cl-lib'
or other parts of Emacs.

Unfortunately I cannot find a replacement for `-keep', which I have been
using a lot.  I propose that we add something like:

  (cl-defgeneric seq-keep (pred sequence)
    "Return a list of all non-nil results of (PRED element) for elements in SEQUENCE."
    (delq nil (seq-map (lambda (elt) (funcall pred elt))
                       sequence)))

Cheers,
Jonas





^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-10-04 19:46 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-03 21:30 bug#58278: Add new function seq-keep Jonas Bernoulli
2022-10-03 23:47 ` Lars Ingebrigtsen
2022-10-04 10:05   ` Robert Pluim
2022-10-04 10:13     ` Lars Ingebrigtsen
2022-10-04 10:27       ` Robert Pluim
2022-10-04 10:42         ` Lars Ingebrigtsen
2022-10-04 10:50           ` Robert Pluim
2022-10-04 11:10             ` Lars Ingebrigtsen
2022-10-04 11:21               ` Robert Pluim
2022-10-04 11:23                 ` Lars Ingebrigtsen
2022-10-04 11:37                   ` Robert Pluim
2022-10-04 12:50   ` Jonas Bernoulli
2022-10-04 13:47     ` Lars Ingebrigtsen
2022-10-04 13:56       ` Lars Ingebrigtsen
2022-10-04 13:59         ` Lars Ingebrigtsen
2022-10-04 19:46           ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).