From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: steve-humphreys@gmx.com Newsgroups: gmane.emacs.help Subject: Re: RE: Understanding the "let" construct and the setting of variables Date: Thu, 17 Dec 2020 21:11:23 +0100 Message-ID: References: <87zh2d1byp.fsf@fastmail.fm> <87tusk2754.fsf@fastmail.fm> <3b1a7936-913a-4736-9b12-0d3e04333c74@default> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15703"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Joost Kremers , help-gnu-emacs@gnu.org To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 17 21:12:19 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kpzdL-0003xm-90 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 17 Dec 2020 21:12:19 +0100 Original-Received: from localhost ([::1]:58744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpzdJ-0003K9-BU for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 17 Dec 2020 15:12:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpzcc-0003K2-SX for help-gnu-emacs@gnu.org; Thu, 17 Dec 2020 15:11:34 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:45657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpzca-00041I-RA for help-gnu-emacs@gnu.org; Thu, 17 Dec 2020 15:11:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608235884; bh=FfvYoQxMubrqpQ3V5HABOgXid5NnN5ync62Qh8kN8m4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Q/2T662ERxmRNfUWjNGJUARsNxYuTARaFQsF2grT5+FzuQqPnhaaVFY3hyqlUb48a plLVbJ7cysEOjaPOUNtukl1mKeq4K3hpv8ECJYrqKmpdz6V0AwaKD0UoVjrf2jnciY DOYQiRhYmHZ/0m+KNGC8ug/wVfs3TdtM4QetQlDg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs11.server.lan [172.19.170.179]) (via HTTP); Thu, 17 Dec 2020 21:11:23 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <3b1a7936-913a-4736-9b12-0d3e04333c74@default> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:QjMnDsK7EYgSC0G0Qc6gtHX9HDzV/TDpcLwp7FqcoILtTz9HNiBMg6sh3/uA7Rbt86C0I 8NILmsn78CAmPHj4xjgBzLdpkI9F2BiG3JzZm732vIepzIt3g+LtWcCEOJ6++OC4JnUjZtWrRO7c 3ahYUyvdJPHUh011eIpM9xgKAfq/XrxGIjrmiMB6r8GmCR/fZ3efY92Px/o9YhlA36Yc+aDE4+67 5xUFtG9cE/dqHhx8AZO49jyYhVcTzgAswM0pScLOzeN7inKunTJIISE3B2ZYLFSMVji5gb5A6Ebw JM= X-UI-Out-Filterresults: notjunk:1;V03:K0:tT5/lODwZwM=:4v247rFgXTBgkMR4fxqEMC X2FcX+oErQSffOj+EsP1O4NICs+/8Ws2MAYa7JZeaJPtsgq7pntafjkFo7tASIvm7DDDaIlEs YLgjTC5qWU3PBKuGUdptFoeYkekTLdkQQxkCTgpP9YWE0SoUmkcxxobsP802oDJnkWu1szPhY uSy3VMYXwtg8lF6szFWbGfQruoUHA3jvf4XDbWtlkEPY+XWgOGnt6r0+9GWxoWK68frrPkRn5 9PQ/oTBeWVZ0OUcRtfbpk/DqRuQSLhgg/cgrAeLutXMafP4vOgDZQ4yGLgppDY8uvTMjQh4su gS2SqQDzGXWXitpkHkgzxAH4h/R9GgToNibynVIbtkp83pKjKZn7Uw5g6a1up5gVcRWqfZYer 27MY1rN1XA8SFNuU0GX2ECfAf72eJK0XGRUcnAe71VXnduIIsUo3w4B1QuLlN7P2Eo3+iBhbT BXgqzIxBZ+y1zltgF2k+HFMkShe91vDoJksdKl7/Mi83FZr7sCPMKK+pfyexU6WglJygollzH S+WDr8mseNlGZGfwok9+0KNUAkSTrYL/pCC/IyXz0teeuXqLEgovW4tBtD+Hv9/N4DtpTfNfb 4wf2jWvZRtSIA= Received-SPF: pass client-ip=212.227.17.20; envelope-from=steve-humphreys@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:126471 Archived-At: > Sent: Thursday, December 17, 2020 at 5:55 PM > From: "Drew Adams" > To: "Joost Kremers" , steve-humphreys@gmx.com > Cc: help-gnu-emacs@gnu.org > Subject: RE: Understanding the "let" construct and the setting of variab= les > > > Yes, indeed. Variables bound with `let` or `let*` only exist inside th= e > > `let`. > > So as soon as you put the closing parenthesis matching the opening > > parenthesis > > directly before the `let`, the variables go out of scope and no longer= exist. > > (There are actually a couple of subtleties involved that make this sta= tement > > less than universally true, but those issues shouldn't concern a begin= ner.) > > This is not true of dynamically scoped, i.e. "special" > vars. > > What is correct to say is that the let _binding_ of the > variable no longer exists, not that the variable itself > no longer exists. > > In the case of a dynamic variable, it continues to exist. > And its binding from the let continues to exist as long > as the code in the let body is executing. > > [Yes, some people will consider a let binding to create > a _new_ variable. In that sense you can say that that > var ceases to exist. But IMO that isn't as clear to > users as it is to distinguish the binding from the var. > And even if you use the words that way, you still need > to point out that the var continues to exist as long as > the code within the let body is executing (when the > binding is for a dynamic var).] I would thing the variable has to be made somewhere. In fact people talk about "unboundp". > The best explanation of let binding in Elisp is in the > Common Lisp doc, IMO. In particular, CLTL2's explanation > of dynamic and lexical binding is quite clear. It applies > equally to Elisp. > > https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node43.html > >