all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Vitalie Spinu <spinuvit@gmail.com>
Cc: 14935-done@debbugs.gnu.org
Subject: bug#14935: 24.3.50; pcase (or) UPAT fails?
Date: Wed, 24 Jul 2013 01:14:10 -0400	[thread overview]
Message-ID: <jwv4nbksg2g.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87ehapf0v3.fsf@gmail.com> (Vitalie Spinu's message of "Tue, 23 Jul 2013 23:00:16 +0200")

>    (pcase "^" 
>      ((or "^" "%") (message "here")))

Yes, this should work, but it incorrectly used `memq' whereas the (or
`"^" `"%") pattern correctly leads to the use of `member'.

I installed the patch below which should fix it,


        Stefan


=== modified file 'lisp/emacs-lisp/pcase.el'
--- lisp/emacs-lisp/pcase.el	2013-07-08 21:54:54 +0000
+++ lisp/emacs-lisp/pcase.el	2013-07-24 05:10:31 +0000
@@ -659,7 +659,11 @@
               (memq-fine t))
           (when all
             (dolist (alt (cdr upat))
-              (unless (or (pcase--self-quoting-p alt)
+              (unless (if (pcase--self-quoting-p alt)
+                          (progn
+                            (unless (or (symbolp alt) (integerp alt))
+                              (setq memq-fine nil))
+                            t)
                           (and (eq (car-safe alt) '\`)
                                (or (symbolp (cadr alt)) (integerp (cadr alt))
                                    (setq memq-fine nil)






  reply	other threads:[~2013-07-24  5:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23 11:30 bug#14935: 24.3.50; pcase (or) UPAT fails? Vitalie Spinu
2013-07-23 12:08 ` Andreas Schwab
2013-07-23 13:44 ` Stefan Monnier
2013-07-23 21:00   ` Vitalie Spinu
2013-07-24  5:14     ` Stefan Monnier [this message]
2013-07-24  7:19       ` Vitalie Spinu

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=jwv4nbksg2g.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=14935-done@debbugs.gnu.org \
    --cc=spinuvit@gmail.com \
    /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.