GNU bug report logs - #59328
29.0.50; `seq-keep' implementation only valid for lists

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Thu, 17 Nov 2022 02:19:02 UTC

Severity: wishlist

Found in version 29.0.50

Full log


Message #38 received at 59328 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, jonas <at> bernoul.li, 59328 <at> debbugs.gnu.org,
 larsi <at> gnus.org
Subject: Re: bug#59328: 29.0.50; `seq-keep' implementation only valid for lists
Date: Fri, 25 Nov 2022 12:34:38 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> #+begin_src emacs-lisp
> (progn
>   (defvar gensym)
>   (let ((gensym (make-symbol "foo")))
>     (eval `(cl-defmethod seq-map (function (thing (head ,gensym)))
>              (append (list (car thing) (cadr thing)) (seq-map function (cddr thing))))
>           t)
>     (equal (list gensym nil 4 46)
>            (seq-keep (lambda (x) (and (integerp x) (* 2 x)))
>                      (list gensym nil 2 'x gensym 23)))))
> #+end_src
>
> returns t with my patch installed and nil else and works without relying
> on something external. I'm not sure if defining methods (for seq-map in
> this case) that are globally visible is allowed in tests, so I
> implemented the example above in a way that the change of the generic
> function is not visible from the outside (thus the "secret" gensym).

We allow things that are globally visible, yes, as that will only
affect testing sessions.  So I think dropping the gensym will be an
improvement.

> Would something like that be acceptable?

Makes sense to me.  Perhaps we should do something similar for other
seq.el tests.




This bug report was last modified 125 days ago.

Previous Next


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