From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Uday S Reddy Newsgroups: gmane.emacs.devel Subject: Re: e and pi Date: Sat, 18 Sep 2010 22:37:02 +0100 Message-ID: References: <8739t9xpt2.fsf@stupidchicken.com> <874odoweqm.fsf@stupidchicken.com> <8762y3onz7.fsf@stupidchicken.com> <87ocbux3y9.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1284846171 8242 80.91.229.12 (18 Sep 2010 21:42:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 18 Sep 2010 21:42:51 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 18 23:42:50 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 1Ox5BH-00008D-SB for ged-emacs-devel@m.gmane.org; Sat, 18 Sep 2010 23:42:49 +0200 Original-Received: from localhost ([127.0.0.1]:58644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ox566-0006s4-Fw for ged-emacs-devel@m.gmane.org; Sat, 18 Sep 2010 17:37:26 -0400 Original-Received: from [140.186.70.92] (port=52663 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ox55z-0006rk-Rk for emacs-devel@gnu.org; Sat, 18 Sep 2010 17:37:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ox55y-0003NM-Pc for emacs-devel@gnu.org; Sat, 18 Sep 2010 17:37:19 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:40785) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ox55y-0003NA-Iv for emacs-devel@gnu.org; Sat, 18 Sep 2010 17:37:18 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ox55u-0006oR-9c for emacs-devel@gnu.org; Sat, 18 Sep 2010 23:37:14 +0200 Original-Received: from cpc10-harb6-0-0-cust112.perr.cable.virginmedia.com ([92.232.137.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Sep 2010 23:37:14 +0200 Original-Received: from u.s.reddy by cpc10-harb6-0-0-cust112.perr.cable.virginmedia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Sep 2010 23:37:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cpc10-harb6-0-0-cust112.perr.cable.virginmedia.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 In-Reply-To: <87ocbux3y9.fsf@stupidchicken.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:130463 Archived-At: On 9/18/2010 8:10 PM, Chong Yidong wrote: > 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? Consider this: (defvar funny nil) (let ((e 25)) (setq funny (lambda (m) (+ e m)))) Now, (funcall funny 2) should return 27. Instead, with dynamic binding, it returns 4.7182... The point is not whether `e' is being bound in a let or a defun. Rather, the point is that we should be able to use a variable like `e' as a free variable in a closure. We can do so only if it is governed by lexical binding. Cheers, Uday