From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: e and pi Date: Sat, 18 Sep 2010 15:10:54 -0400 Message-ID: <87ocbux3y9.fsf@stupidchicken.com> References: <8739t9xpt2.fsf@stupidchicken.com> <874odoweqm.fsf@stupidchicken.com> <8762y3onz7.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1284837100 7418 80.91.229.12 (18 Sep 2010 19:11:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 18 Sep 2010 19:11:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 18 21:11:38 2010 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 1Ox2om-0006md-RD for ged-emacs-devel@m.gmane.org; Sat, 18 Sep 2010 21:11:38 +0200 Original-Received: from localhost ([127.0.0.1]:42948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ox2od-0005U8-Ol for ged-emacs-devel@m.gmane.org; Sat, 18 Sep 2010 15:11:15 -0400 Original-Received: from [140.186.70.92] (port=35127 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ox2oT-0005SC-Vl for emacs-devel@gnu.org; Sat, 18 Sep 2010 15:11:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ox2oL-0007MA-El for emacs-devel@gnu.org; Sat, 18 Sep 2010 15:10:58 -0400 Original-Received: from pantheon-po16.its.yale.edu ([130.132.50.72]:43069) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ox2oL-0007M4-Bw for emacs-devel@gnu.org; Sat, 18 Sep 2010 15:10:57 -0400 Original-Received: from furry (173-166-31-145-newengland.hfc.comcastbusiness.net [173.166.31.145]) (authenticated bits=0) by pantheon-po16.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o8IJAt7p006363 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 18 Sep 2010 15:10:56 -0400 Original-Received: by furry (Postfix, from userid 1000) id 8E570C018; Sat, 18 Sep 2010 15:10:54 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Sat, 18 Sep 2010 10:30:24 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 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:130440 Archived-At: Stefan Monnier writes: >> If function argument names are the problem, why not just give them >> static scope, overriding any existing dynamic bindings? While it's >> idiomatic elisp to use `let' to bind dynamic variables, AFAICT no one >> uses function arguments to do the same. > > No, the issue is: > > does (let ((foo bar)) ...) bind `foo' lexically or dynamically? You're switching examples. Remember, I originally asked what's the exact problem with binding `e' dynamically. You came up with this example: (defun make-inc (e) (lambda (m) (+ e m))) (let ((f (make-inc 3))) (funcall f 5)) I agree that static scoping is much better in this example. But we could fix this simply by imposing static scope on function arguments. So, is there an equivalent scenario in which the proposed change to `let' is clearly desireable? > That's been used for ages in Common-Lisp. And it's the only > reasonable way to convert Elisp packages from dynamic-scoping to > static-scoping without having to change all `let' to something else > (like lexical-let). My question is, what's the advantage that we gain from automagically converting to static scoping? If 99% of the static scoping advantage involves static scoping of function args, while 99% of the disruption comes from converting `let' forms, then maybe we should do one and not the other.