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

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

bug#34781: 27.0.50; integer in pcase sometimes compared by eq


From: Stefan Monnier
Subject: bug#34781: 27.0.50; integer in pcase sometimes compared by eq
Date: Thu, 28 Mar 2019 18:11:23 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>                     (let ((upat (cddr alt)))
>                       (eq (car-safe upat) 'quote)))
>                (let ((val (cadr (cddr alt))))
> -                (unless (or (integerp val) (symbolp val))
> +                (unless (or (portable-fixnum-p val) (symbolp val))
>                    (setq memq-ok nil))
>                  (push (cadr (cddr alt)) simples))
>              (push alt others))))

Really?
I think the better option is below (since I think we should generally
move away from `eq` and replace it with `eql`).

Actually, the hunk below should have been installed at the same time
I replaced `eq` with `eql` when testing against an integer.  It was
a mere oversight.


        Stefan


diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 9de240154..d9a20b1ff 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -802,7 +802,7 @@ pcase--u1
        ((> (length simples) 1)
         (pcase--u1 (cons `(match ,var
                                  . (pred (pcase--flip
-                                          ,(if memq-ok #'memq #'member)
+                                          ,(if memq-ok #'memql #'member)
                                           ',simples)))
                          (cdr matches))
                    code vars





reply via email to

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