GNU bug report logs - #58278
Add new function seq-keep

Previous Next

Package: emacs;

Reported by: Jonas Bernoulli <jonas <at> bernoul.li>

Date: Mon, 3 Oct 2022 21:31:02 UTC

Severity: normal

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Robert Pluim <rpluim <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 58278 <at> debbugs.gnu.org, Jonas Bernoulli <jonas <at> bernoul.li>
Subject: bug#58278: Add new function seq-keep
Date: Tue, 04 Oct 2022 13:21:06 +0200
>>>>> On Tue, 04 Oct 2022 13:10:38 +0200, Lars Ingebrigtsen <larsi <at> gnus.org> said:

    Lars> Robert Pluim <rpluim <at> gmail.com> writes:
    >> Thatʼs why I said "apart from the syntactic sugar" 😀

    Lars> Having to rewrite

    Lars> (seq-keep #'cl-digit-char-p '(?6 ?a))
    Lars> => (6)

    Lars> to

    Lars> (cl-mapcan (lambda (c)
    Lars> 	     (let ((res (cl-digit-char-p c)))
    Lars> 	       (and res (list res))))
    Lars> 	   '(?6 ?a))
    Lars> => (6)

    Lars> is more than "syntactic sugar" in my book.  Nobody would want to write
    Lars> code like the latter.

I never meant that. I meant defining `seq-keep' in terms of `'cl-mapcan',
with the appropriate converting elements to lists done for you (or
even using `mapcan' if youʼre willing to give up the &rest behaviour
of `cl-mapcan')

Robert
-- 




This bug report was last modified 2 years and 271 days ago.

Previous Next


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