From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.bugs Subject: bug#8711: 24.0.50; binding _ to unused values with lexical-binding Date: Mon, 23 May 2011 22:32:56 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1306182981 1675 80.91.229.12 (23 May 2011 20:36:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 23 May 2011 20:36:21 +0000 (UTC) To: 8711@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 23 22:36:15 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QObrK-0001dX-11 for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 May 2011 22:36:14 +0200 Original-Received: from localhost ([::1]:55052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QObrJ-0008Bf-HA for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 May 2011 16:36:13 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:55759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QObpD-0004I0-Qf for bug-gnu-emacs@gnu.org; Mon, 23 May 2011 16:34:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QObpC-0000h2-TZ for bug-gnu-emacs@gnu.org; Mon, 23 May 2011 16:34:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QObpC-0000gy-PC for bug-gnu-emacs@gnu.org; Mon, 23 May 2011 16:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QObpC-00033o-DF; Mon, 23 May 2011 16:34:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Helmut Eller Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 May 2011 20:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8711 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.130618280711722 (code B ref -1); Mon, 23 May 2011 20:34:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 May 2011 20:33:27 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QOboc-000331-VO for submit@debbugs.gnu.org; Mon, 23 May 2011 16:33:27 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QOboa-00032n-J0 for submit@debbugs.gnu.org; Mon, 23 May 2011 16:33:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOboU-0000c0-Ln for submit@debbugs.gnu.org; Mon, 23 May 2011 16:33:19 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:44054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOboU-0000bu-Jw for submit@debbugs.gnu.org; Mon, 23 May 2011 16:33:18 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:55615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOboT-0002s6-MG for bug-gnu-emacs@gnu.org; Mon, 23 May 2011 16:33:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOboS-0000bi-OO for bug-gnu-emacs@gnu.org; Mon, 23 May 2011 16:33:17 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:36886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOboS-0000bc-HW for bug-gnu-emacs@gnu.org; Mon, 23 May 2011 16:33:16 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QOboQ-00086u-Vf for bug-gnu-emacs@gnu.org; Mon, 23 May 2011 22:33:14 +0200 Original-Received: from 212.46.168.133 ([212.46.168.133]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 May 2011 22:33:14 +0200 Original-Received: from eller.helmut by 212.46.168.133 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 May 2011 22:33:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 20 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 212.46.168.133 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:J3UnIommYjAn2nlBl165CJ1SeCE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 23 May 2011 16:34:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46669 Archived-At: * Stefan Monnier [2011-05-23 19:29] writes: > I think the same problem happens with dotimes/dolist using the old > definition: the loop vars `key' and `value' are let-bound outside the > loop and then setq'd at each loop iteration (it's this setq that causes > them to be "not left unused"). This was OK for the dynamic scoping case > because let-binding is significantly more costly than setq, but it is > not right for the lexical scoping case where the cost of let is not > higher than `setq' and where the semantic is actually then wrong: > e.g. if you "collect (lambda () value)" the current code ends up > returning a list of functions that all return the last `value', rather > than a list of functions that each return one of the `values' in > the alist. BTW, is there a good reason why we can't disallow setq on closed over variables in Elisp? That kind of mutability seems like a bad idea in a concurrent world. Closures are a new feature so we could make a conscious decision not to introduce the problematic mutable variables. Helmut