From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.bugs Subject: bug#26068: [PATCH] bug in generator function with pcase Date: Sat, 1 Apr 2017 15:44:16 +0200 Message-ID: References: <87efxcp95i.fsf@calancha-pc> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=94eb2c11acc6564a6d054c1b1ff8 X-Trace: blaine.gmane.org 1491054327 4020 195.159.176.226 (1 Apr 2017 13:45:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 1 Apr 2017 13:45:27 +0000 (UTC) Cc: Mark Oteiza , 26068@debbugs.gnu.org, Stefan Monnier To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 01 15:45:22 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuJL1-0007TV-S0 for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Apr 2017 15:45:08 +0200 Original-Received: from localhost ([::1]:51391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuJL7-0007mx-UL for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Apr 2017 09:45:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuJKz-0007jw-7F for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2017 09:45:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cuJKw-0007CA-2E for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2017 09:45:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cuJKv-0007C5-VZ for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2017 09:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cuJKv-0007mn-QB for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2017 09:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Apr 2017 13:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26068 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 26068-submit@debbugs.gnu.org id=B26068.149105426429873 (code B ref 26068); Sat, 01 Apr 2017 13:45:01 +0000 Original-Received: (at 26068) by debbugs.gnu.org; 1 Apr 2017 13:44:24 +0000 Original-Received: from localhost ([127.0.0.1]:55189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuJKK-0007lk-GO for submit@debbugs.gnu.org; Sat, 01 Apr 2017 09:44:24 -0400 Original-Received: from mail-pf0-f174.google.com ([209.85.192.174]:33941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuJKI-0007lV-UI for 26068@debbugs.gnu.org; Sat, 01 Apr 2017 09:44:23 -0400 Original-Received: by mail-pf0-f174.google.com with SMTP id 197so4864216pfv.1 for <26068@debbugs.gnu.org>; Sat, 01 Apr 2017 06:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lTdAeICBIlMfndJmXzdud6ngJE44hSjiZ31vM8UTRjc=; b=jqdi4n1s3vWrn5zCuU4C2pFNspG8vzCxucjL767i0OKKz/L0U0EtKM5TfGqSrWKpak TO9spsn+nW0tquQ9gaGdQQjUL8hY8h12ii2SKTo4NPLIHNHDX2pcBpsgjEuii+8676m4 1LghpLvYv7Lzs7PNMP+GLtKVK3oZoOgceJHGLEUBtVi9aN/j67wj3xPepTGlz1EmzKr8 wapr77pDkvpUPI4HdsjJzoGoCOVPMTErRa+znx124cGSyOoBqIc+Tvp55n1rJIhLf4k0 8nN4lIQDvpCR2Y+SEYKe6L5lfwJnCRjXIEgQ6K7a6KPn7hjJb0e7OFdSU5+hpJG0dlak lM0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lTdAeICBIlMfndJmXzdud6ngJE44hSjiZ31vM8UTRjc=; b=gY2xc+SlRgCo1yxFxGbD04/U+xmvVjW0UPGi6yHs+TRJ76Srht7R7esrpZj/1seHmk qvlJpZUvjExE8bXGGXujC6P40DmamBV++G41MvSr3eR4H913yXNOPvs1uCAINTGB1bp5 4tXiKohNasX1l1ExPLgGvWoKL7NTnk8Mwx4JRCNeoCxeqYkTUcrv0azRSRrNmGmqXOe7 jzTvNFRlVt5APIE3Dfz7DTPEXI15wg/fnUy6a97/MauA12LOAevFGv6y/gKEQKnM3TnK KR4VEwnzpHcCFCnpD6e4cQe9mGdl7/TEdcRTuWkAyNdSBB28vY0gzNU1qvKt9PygdygM 1O9w== X-Gm-Message-State: AFeK/H0njpUB41wgfN3JvdjfQBJdTJi45cSRhtn3MHnwuxDaqpxtO1QvwQDMAq+WfGysJmk2yuSJYK1hdNV71A== X-Received: by 10.84.230.129 with SMTP id e1mr9391508plk.66.1491054257117; Sat, 01 Apr 2017 06:44:17 -0700 (PDT) Original-Received: by 10.100.143.234 with HTTP; Sat, 1 Apr 2017 06:44:16 -0700 (PDT) In-Reply-To: <87efxcp95i.fsf@calancha-pc> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131172 Archived-At: --94eb2c11acc6564a6d054c1b1ff8 Content-Type: text/plain; charset=UTF-8 Attached is the testcase from the bug as a patch. It might be best to reformulate it without `pcase' though, to avoid depending on its implementation details. The testcase fails before the patch, passes now. So, I don't know anything about `cl-flet', but the patch was not without reasons. Paul On 1 April 2017 at 15:08, Tino Calancha wrote: > Paul Pogonyshev writes: > >> To reproduce: >> >> (iter-next (funcall (iter-lambda () (pcase (list 1 2) >> (`(,a ,b) (iter-yield (+ a b))))))) >> >> Patch is attached. I have no idea if it affects something else, but >> matching symbols with `eq' on their names (`eq' on strings?!) seems >> outright wrong to me. > It looks also weird to me. It seems written on purpose in order to > not expand fuction names in `cl-symbol-macrolet'. > > Stefan has added a new test 2 days ago which fails after your > patch: > * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-symbol-macrolet) --94eb2c11acc6564a6d054c1b1ff8 Content-Type: text/plain; charset=US-ASCII; name="pcase-generator-test.diff" Content-Disposition: attachment; filename="pcase-generator-test.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j0zb75o50 ZGlmZiAtLWdpdCBhL3Rlc3QvbGlzcC9lbWFjcy1saXNwL2dlbmVyYXRvci10ZXN0cy5lbCBiL3Rl c3QvbGlzcC9lbWFjcy1saXNwL2dlbmVyYXRvci10ZXN0cy5lbAppbmRleCAxYTU2N2FjNzBmLi4x MTU0MmFiMTVkIDEwMDY0NAotLS0gYS90ZXN0L2xpc3AvZW1hY3MtbGlzcC9nZW5lcmF0b3ItdGVz dHMuZWwKKysrIGI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