From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-15?Q?Kai_Gro=DFjohann?= Newsgroups: gmane.emacs.help Subject: Re: Declaring a local dynamic variable? Date: Sun, 13 Oct 2013 21:56:33 +0200 Message-ID: <525AFAF1.8010707@gmx.net> References: <1319c316-9f24-46e1-b774-b7ea11a84ea2@googlegroups.com> <525A55FA.10601@easy-emacs.de> <525ADB5A.8040407@easy-emacs.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1381694190 32323 80.91.229.3 (13 Oct 2013 19:56:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Oct 2013 19:56:30 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?ISO-8859-15?Q?Andreas_R=F6hler?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 13 21:56:34 2013 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 1VVRmD-0004Fc-1U for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Oct 2013 21:56:33 +0200 Original-Received: from localhost ([::1]:34402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVRmC-0007fc-JY for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Oct 2013 15:56:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVRln-0007fS-CO for help-gnu-emacs@gnu.org; Sun, 13 Oct 2013 15:56:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVRlg-0001F5-3D for help-gnu-emacs@gnu.org; Sun, 13 Oct 2013 15:56:07 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:55695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVRlf-0001Ez-QG for help-gnu-emacs@gnu.org; Sun, 13 Oct 2013 15:56:00 -0400 Original-Received: from marcie.lan ([188.100.165.77]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0LfHs4-1W6e8s2q88-00olGT for ; Sun, 13 Oct 2013 21:55:58 +0200 User-Agent: Postbox 3.0.8 (Macintosh/20130427) Original-Newsgroups: gmane.emacs.help In-Reply-To: <525ADB5A.8040407@easy-emacs.de> X-Provags-ID: V03:K0:n0B/0xx9eDPHDaOG7p2y/BEtdKtHcK6uj9rDGBuDUtAvcsYNweF i82/sefdb65jF7VPnMklSGDPtE7XqMLCO+OQVpnB0LdcXkRZjV7gx4zEu3cAMlHw/M5tj/R gXvbdEGjjEQZD944wUrqWitKD/2mM7BiwlXjpvO61cal/GXdNHk7HU7g4d8EoP1I13MK+7V 9Otb6P4aBqWtlgmhQeo7Q== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.15.15 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:94004 Archived-At: Andreas Röhler wrote: > Am 13.10.2013 15:37, schrieb Stefan Monnier: >>>> The above code has the same effect as >>>> - create global variable x, initialize it to 5 >>>> - execute bla bla >>>> - change value of x to 6 >>> No. Introduces a let-bound x, which is unrelated to global x >> >> You're confused. > > Really? > > So that's what I get: > > (defvar x 5) > x->5 > > (let ((x 6)) > x) > > ->6 (#o6, #x6, ?\C-f) This observation can be explained in two ways: - Either you have a new variable x with a new value. (This is what you are talking about.) - Or you have a new value for the existing variable x. (This is what Stefan and I are talking about.) Let's say you have this code: (defvar x 5) (defun foo () (+ x 3)) It seems that we can say that the function foo accesses the global variable x. Now we write this: (let ((x 6)) (foo)) Under Stefan's and my explanation, we can still say that the function foo accesses the global variable x -- it just has a different value here. Under your explanation, we would need to say that foo doesn't access the global variable x anymore, instead it accesses a different variable x. Kai