bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58278: Add new function seq-keep


From: Jonas Bernoulli
Subject: bug#58278: Add new function seq-keep
Date: Mon, 03 Oct 2022 23:30:13 +0200

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]