From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Lexical binding Date: Mon, 04 Apr 2011 18:34:00 -0400 Message-ID: References: <877hb91xoi.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1301956457 7068 80.91.229.12 (4 Apr 2011 22:34:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Apr 2011 22:34:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 05 00:34:13 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6sLY-0000cQ-Ug for ged-emacs-devel@m.gmane.org; Tue, 05 Apr 2011 00:34:09 +0200 Original-Received: from localhost ([127.0.0.1]:38610 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6sLY-0004Qp-8J for ged-emacs-devel@m.gmane.org; Mon, 04 Apr 2011 18:34:08 -0400 Original-Received: from [140.186.70.92] (port=48555 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6sLU-0004Qk-9A for emacs-devel@gnu.org; Mon, 04 Apr 2011 18:34:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q6sLT-0003sA-BD for emacs-devel@gnu.org; Mon, 04 Apr 2011 18:34:04 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:35080 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q6sLR-0003rt-J9; Mon, 04 Apr 2011 18:34:01 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAPNGmk1Ld/Y6/2dsb2JhbAClZHiIeboZhWsElj8 X-IronPort-AV: E=Sophos;i="4.63,300,1299474000"; d="scan'208";a="103165683" Original-Received: from 75-119-246-58.dsl.teksavvy.com (HELO pastel.home) ([75.119.246.58]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 04 Apr 2011 18:34:00 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 7A6E158C5B; Mon, 4 Apr 2011 18:34:00 -0400 (EDT) In-Reply-To: <877hb91xoi.fsf@fencepost.gnu.org> (David Kastrup's message of "Tue, 05 Apr 2011 00:03:41 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.183 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138164 Archived-At: > Go through a stage > (condition-case :fun-body (lambda () ignore) > (multi-lambda (x) (quit (x test) test) (error (x test) test))) Yes, that's my current "best plan" indeed, except it'd be (split-binding (test) (condition-case :fun-body (lambda () ) (quit (lambda (test) test) (error (lambda (test) test))) so it affects as little as possible the rest of the code. But the above can interfere with other uses of `test' in so it needs to be more precise, maybe something like: (split-binding (test #:x) (condition-case :fun-body (lambda () ) (quit (lambda (#:x) test) (error (lambda (#:x) test))) but it's more difficult to make this work with the interpreter. > or something similar where the byte compiler does the "unused variable" > check (or a setup for it) during the multi-lambda expansion stage. What > kind of form is exactly needed here in order to cater for all such > situations will require careful thinking. Yes, that's currently my "best plan", but since it would also be useful for macros like dolist/loop/pcase, it shouldn't be too hackish and work well for the interpreted case as well. Stefan