From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Real-life examples of lexical binding in Emacs Lisp Date: Wed, 17 Jun 2015 02:06:42 +0200 Organization: Aioe.org NNTP Server Message-ID: <87vbendwq5.fsf@debian.uxu> References: <87bnh3eqiv.fsf@mbork.pl> <874mmuxyd5.fsf@gnu.org> <87k2v6wmpy.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1434499519 4307 80.91.229.3 (17 Jun 2015 00:05:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Jun 2015 00:05:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 17 02:05:18 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z50qz-0006T1-29 for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Jun 2015 02:05:17 +0200 Original-Received: from localhost ([::1]:43349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z50qy-0001NI-9k for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Jun 2015 20:05:16 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 40 Original-NNTP-Posting-Host: feB02bRejf23rfBm51Mt7Q.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:g+R1s5Sz1JjEx2MsytCQYdVHqJI= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:212708 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104992 Archived-At: Jim Diamond writes: > Really? Are there well-agreed-upon studies showing > those things? Or are they your opinion? > > It strikes me that lexical scoping is easier to > implement for compiled languages (that is an "off > the cuff" comment from someone (me) with basic > knowledge of compiler construction). But if lexical > scoping is "more natural", is that because more > people were "brought up" with lexically-scoped > languages than dynamically-scoped languages? This discussion is much easier to have if that confusing terminology is dropped for a second and we instead study the simple example of a `let' form: (let ((scratch-buffer "*scratch*")) (when (bufferp scratch-buffer) (kill-buffer scratch-buffer) )) Here we have one piece of data which is used twice, so that data is named and when it is used it is indirectly refered to. In this example, what is natural to me? Answer: I don't expect `let' to affect any other code than the code in the `let' itself! And this is "lexical scoping". Is it really so, that you expect it to be in another way? If so - OK. I don't think most people feel like that and I certainly don't, because I don't program that way and the impression is made even stronger with the LISP syntax of enclosed lists. -- underground experts united http://user.it.uu.se/~embe8573