From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: dynamic and lexical scope, attempted summary with example Date: Mon, 21 Jul 2014 11:23:30 +0200 Message-ID: <87egxf9ib1.fsf@web.de> References: <878unputvv.fsf@debian.uxu> <87bnsjsorp.fsf_-_@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1405934653 25560 80.91.229.3 (21 Jul 2014 09:24:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Jul 2014 09:24:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 21 11:24:07 2014 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 1X99pG-0002Xf-Iv for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Jul 2014 11:24:06 +0200 Original-Received: from localhost ([::1]:33066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X99pG-0003tB-2R for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Jul 2014 05:24:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X99p0-0003sx-0b for help-gnu-emacs@gnu.org; Mon, 21 Jul 2014 05:23:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X99ot-0000PO-K1 for help-gnu-emacs@gnu.org; Mon, 21 Jul 2014 05:23:49 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:39298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X99ot-0000PA-DG for help-gnu-emacs@gnu.org; Mon, 21 Jul 2014 05:23:43 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1X99os-0002FW-Ae for help-gnu-emacs@gnu.org; Mon, 21 Jul 2014 11:23:42 +0200 Original-Received: from dslb-094-217-127-201.pools.arcor-ip.net ([94.217.127.201]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 Jul 2014 11:23:42 +0200 Original-Received: from michael_heerdegen by dslb-094-217-127-201.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 Jul 2014 11:23:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 21 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslb-094-217-127-201.pools.arcor-ip.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) Cancel-Lock: sha1:hvzvpJEHInQeHq7fqu7ATADH/ro= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:98854 Archived-At: Emanuel Berg writes: > As always, I think it is easier to discuss in terms of > an example... Right, but I think in this case, it's not a good idea to learn that in passing. I really recommend to read some literature about it - this isn't trivial. Both kinds of scope have their rights to exist and their use cases. When I first heard about scope, I though "This does only matter in situations I avoid". But lexical scope in a functional language is a basis of lots of advanced programming techniques. OTOH, dynamic scope is as well imperative to programming in LISP. It's explained e.g. here: http://www.paulgraham.com/onlisp.html There are books easier to read than this, but the chapter about scope is well understandable without reading the rest, I think.