all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Paul Pogonyshev <pogonyshev@gmail.com>
Cc: Mark Oteiza <mvoteiza@udel.edu>,
	26068@debbugs.gnu.org, Tino Calancha <tino.calancha@gmail.com>
Subject: bug#26068: [PATCH] bug in generator function with pcase
Date: Sat, 01 Apr 2017 12:12:15 -0400	[thread overview]
Message-ID: <jwvtw68p1fq.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <CAG7BpapDfHm97A3YMq7Gf2_NtC_2dWUx-QSh2-2SvopPSeuhEg@mail.gmail.com> (Paul Pogonyshev's message of "Sat, 1 Apr 2017 15:44:16 +0200")

> +;; Bug #26068.  The problem is that `pcase' uses several `x' symbols,
> +;; which are not identical, but have the same name.
> +(ert-deftest cps-test-symbols-with-same-name ()
> +  (should (equal (iter-next (funcall (iter-lambda () (pcase (list 1 2)
> +                                                       (`(,a ,b) (iter-yield (+ a b)))))))
> +                 3)))

Right.  I guess the core if the issue would be reproduced with something like

    (defmacro cl-lib-symbol-macrolet-4+5 ()
      (let* ((sname "x")
             (s1 (make-symbol sname))
             (s2 (make-symbol sname)))
        `(cl-symbol-macrolet ((,s1 4)
                              (,s2 5))
           (+ ,s1 ,s2))))
    (ert-deftest cl-lib-symbol-macrolet-2 ()
      (should (equal (cl-lib-symbol-macrolet-4+5) (+ 4 5))))

Before your patch, the macro's code returned 10 rather than 9.

I installed this test in cl-lib-tests.el.


        Stefan





      reply	other threads:[~2017-04-01 16:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-12  8:51 bug#26068: [PATCH] bug in generator function with pcase Paul Pogonyshev
2017-03-19 19:18 ` Mark Oteiza
2017-04-01 13:08 ` Tino Calancha
2017-04-01 13:44   ` Paul Pogonyshev
2017-04-01 16:12     ` Stefan Monnier [this message]

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=jwvtw68p1fq.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=26068@debbugs.gnu.org \
    --cc=mvoteiza@udel.edu \
    --cc=pogonyshev@gmail.com \
    --cc=tino.calancha@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.