From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: Understanding the "let" construct and the setting of variables Date: Thu, 17 Dec 2020 08:58:39 +0100 Message-ID: <87tusk2754.fsf@fastmail.fm> References: <87zh2d1byp.fsf@fastmail.fm> 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="23198"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.7; emacs 27.1.50 Cc: help-gnu-emacs@gnu.org To: steve-humphreys@gmx.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 17 09:02:14 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 1kpoEn-0005ux-KO for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 17 Dec 2020 09:02:13 +0100 Original-Received: from localhost ([::1]:47972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpoEm-0005nC-Mh for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 17 Dec 2020 03:02:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpoEE-0005n6-8M for help-gnu-emacs@gnu.org; Thu, 17 Dec 2020 03:01:38 -0500 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:50083) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpoEA-0006kM-8K for help-gnu-emacs@gnu.org; Thu, 17 Dec 2020 03:01:38 -0500 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 943A043F; Thu, 17 Dec 2020 03:01:32 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 17 Dec 2020 03:01:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:cc:subject:date:in-reply-to:message-id :mime-version:content-type:content-transfer-encoding; s=fm1; bh= PQmurhp0kvIzzj2b5A9b8/LDifvIKTnpne1PoEm7rV4=; b=nl1mO/4gGRDuGsGF vIJe8h6248F4W+V8pCp9ej8u2bIJeFV2/5CiNBpdHr7qQNeeabVmbm1JIRhNOEfh +iWMv/IWobOeM9WWH3h3qBd5BLb0QD6oNlnNjDVLkgIpW+0dHVgPvbdd7Pn7S2nk GYF9hBWWI7LDU7KOw18LLtVKpNw3qp59WWGkN84La9XMrX6mALSHj5cNRg/EWFaW zJUbcbbgCVXp3DLIs1yW1O7UfVt4FNZxhXgbXsx+15OLT17f4khza98KxL39cL0D irJ+imFwjA/3ZSaPiKwiwVOYMnPzjWIPsHvboIzF1KSQUhQ1OXH5zbgUcTDy/9ta psJoGQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=PQmurhp0kvIzzj2b5A9b8/LDifvIKTnpne1PoEm7r V4=; b=HurW+UokH5cxYIitPtYxfzAwU4E2BBX1920fR8S/1eEIqK6rbahwAlFVD BP+HA1dV237e1wx0NpzzaKbVMRu+51F0adn4HWYoArQxRXyJn3Azz4UjcrWZxyX3 asaFx+54il+hAA2WZa53OT3KAGdMJVrsnTNuelMxHDsiFzYnJ0JkuTpks23dh7GQ wL/pXqNKen3lOsOGVmsSmffdVCPQ1tsb4sKpaz5fUrb+a1tBZO5A3MmLSUF0n1wO 3tOVeMnzv30bFoN2xe02t3HEQitRXPw+kKyb9/FMiIhFp+ehFSCCaf58DJrqSAva kcs60oZaccDS1S4UwWO7sCY85f4HA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudelfedgudduiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfhgfhffvufffjgfkgggtgfesth hqredttderjeenucfhrhhomheplfhoohhsthcumfhrvghmvghrshcuoehjohhoshhtkhhr vghmvghrshesfhgrshhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepvddvgfeghf dtiefhvedvvddtjefhleejveeltdelffevhfeijeekhfdutdffgeefnecukfhppeelhedr ledtrddvvdegrddvgeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepjhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: from Swift.fastmail.com (ip5f5ae0f6.dynamic.kabel-deutschland.de [95.90.224.246]) by mail.messagingengine.com (Postfix) with ESMTPA id 1FFB6240062; Thu, 17 Dec 2020 03:01:30 -0500 (EST) In-reply-to: Received-SPF: pass client-ip=64.147.123.19; envelope-from=joostkremers@fastmail.fm; helo=wout3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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:126452 Archived-At: On Thu, Dec 17 2020, steve-humphreys@gmx.com wrote: > I ran the following=20=20 > > ELISP> tima > (lett 845 80) > "tim_out: 1005" > > ELISP> tim > *** Eval error *** Symbol=E2=80=99s value as variable is void: tim > > ELISP> (lett 845 90) > "tim_out: 1015" > > ELISP> tim > *** Eval error *** Symbol=E2=80=99s value as variable is void: tim > > So this is quite different from using "setq". The variable "tim" is > not available to all of emacs. Yes, indeed. Variables bound with `let` or `let*` only exist inside the `le= t`. So as soon as you put the closing parenthesis matching the opening parenthe= sis directly before the `let`, the variables go out of scope and no longer exis= t. (There are actually a couple of subtleties involved that make this statement less than universally true, but those issues shouldn't concern a beginner.) --=20 Joost Kremers Life has its moments