all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: Paul Eggert <eggert@cs.ucla.edu>, 34781@debbugs.gnu.org
Subject: bug#34781: 27.0.50; integer in pcase sometimes compared by eq
Date: Thu, 28 Mar 2019 18:11:23 -0400	[thread overview]
Message-ID: <jwvsgv6zmb7.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <3a02a3378a526c8706b33f36b85c003a82aa2aa1.camel@acm.org> ("Mattias Engdegård"'s message of "Thu, 28 Mar 2019 22:51:39 +0100")

>                     (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





  parent reply	other threads:[~2019-03-28 22:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 15:13 bug#34781: 27.0.50; integer in pcase sometimes compared by eq Mattias Engdegård
     [not found] ` <handler.34781.B.15519717565134.ack@debbugs.gnu.org>
2019-03-12 12:24   ` bug#34781: Acknowledgement (27.0.50; integer in pcase sometimes compared by eq) Mattias Engdegård
2019-03-16 19:09     ` bug#34781: 27.0.50; integer in pcase sometimes compared by eq Mattias Engdegård
2019-03-28 18:25 ` Paul Eggert
2019-03-28 19:47   ` Michael Heerdegen
2019-03-28 20:33     ` Paul Eggert
2019-03-28 21:30       ` Michael Heerdegen
2019-03-28 19:51   ` Mattias Engdegård
2019-03-28 20:30     ` Paul Eggert
2019-03-28 21:51       ` Mattias Engdegård
2019-03-28 22:10         ` Paul Eggert
2019-03-28 22:11         ` Stefan Monnier [this message]
2019-03-28 22:20           ` Mattias Engdegård
2019-03-28 22:38             ` Paul Eggert
2019-03-28 23:03               ` Mattias Engdegård
2019-03-29  8:48         ` Eli Zaretskii
2019-03-29  9:52           ` Mattias Engdegård
2019-03-29 12:33             ` Eli Zaretskii
2019-03-28 19:43 ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvsgv6zmb7.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=34781@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=mattiase@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.