From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#26073: workaround Date: Mon, 20 Mar 2017 09:25:01 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1490016387 29878 195.159.176.226 (20 Mar 2017 13:26:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 20 Mar 2017 13:26:27 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 26073@debbugs.gnu.org To: Paul Pogonyshev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 20 14:26:19 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 1cpxK6-0006PW-5V for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Mar 2017 14:26:10 +0100 Original-Received: from localhost ([::1]:33004 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpxKC-0004A8-2q for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Mar 2017 09:26:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpxK4-00049B-Im for bug-gnu-emacs@gnu.org; Mon, 20 Mar 2017 09:26:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpxJz-0007sx-2y for bug-gnu-emacs@gnu.org; Mon, 20 Mar 2017 09:26:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37763) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cpxJy-0007sl-IH for bug-gnu-emacs@gnu.org; Mon, 20 Mar 2017 09:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cpxJy-0007kC-7V for bug-gnu-emacs@gnu.org; Mon, 20 Mar 2017 09:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Mar 2017 13:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.149001631829693 (code B ref 26073); Mon, 20 Mar 2017 13:26:02 +0000 Original-Received: (at 26073) by debbugs.gnu.org; 20 Mar 2017 13:25:18 +0000 Original-Received: from localhost ([127.0.0.1]:35962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpxJG-0007iq-3R for submit@debbugs.gnu.org; Mon, 20 Mar 2017 09:25:18 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:55140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpxJE-0007ie-79 for 26073@debbugs.gnu.org; Mon, 20 Mar 2017 09:25:17 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BODABY189Y/yTkr2xeGwEBAQMBAQEJAQEBg1FBhD6FWIV5kGkpAZcnhhwEAgKDB0QUAQIBAQEBAQEBayiFFgEEAVYjBQsLNBIUGA0kLoldCLNcikYBAQEBBgImiz2KOQEEnE2dCoZkkhSBRDYhgQQjFggshzQkiigBAQE X-IPAS-Result: A0BODABY189Y/yTkr2xeGwEBAQMBAQEJAQEBg1FBhD6FWIV5kGkpAZcnhhwEAgKDB0QUAQIBAQEBAQEBayiFFgEEAVYjBQsLNBIUGA0kLoldCLNcikYBAQEBBgImiz2KOQEEnE2dCoZkkhSBRDYhgQQjFggshzQkiigBAQE X-IronPort-AV: E=Sophos;i="5.36,194,1486443600"; d="scan'208";a="295885904" Original-Received: from 108-175-228-36.dsl.teksavvy.com (HELO ceviche.home) ([108.175.228.36]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Mar 2017 09:25:07 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id A4C56661C2; Mon, 20 Mar 2017 09:25:01 -0400 (EDT) In-Reply-To: (Paul Pogonyshev's message of "Mon, 20 Mar 2017 10:04:16 +0100") 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:130751 Archived-At: >> I'm wondering why generator.el uses cl-symbol-macrolet like that > Because that's how it works. It needs to store variables in an outer > scope so that their values are preserved between calls to `iter-next' > on the same iterator. Therefore it "rebinds" local variables to > different symbol and declares those symbols in outer scope, so that > they become non-local variables captured by resulting closures. Could you give me some concrete (but simple) example? > bug in in `cl-symbol-macrolet' that incorrectly applies `bindings' to > forms with lambdas. Yes, I understand this part of the problem (and fixing it should actually be easier than for `let` since in lexical-binding mode, all lambda args are lexically scoped, regardless of special-variable-p). [ Note: I haven't looked at your suggested patch, but I agree with your problem&solution description so your patch is probably right. ] Stefan