From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: master b72f885: Make dlet work like let, not let* Date: Mon, 20 Sep 2021 21:16:17 +0200 Message-ID: <87y27rhwp0.fsf@gnu.org> References: <83wnp5m9i5.fsf@gnu.org> 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="11674"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.6; emacs 28.0.50 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 20 21:32:21 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mSP1Y-0002s8-QH for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 21:32:20 +0200 Original-Received: from localhost ([::1]:37496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSP1X-0006Bn-6n for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 15:32:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSOzs-0004ib-Uz for emacs-devel@gnu.org; Mon, 20 Sep 2021 15:30:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43498) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSOzr-0000rL-L2 for emacs-devel@gnu.org; Mon, 20 Sep 2021 15:30:35 -0400 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:45181) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSOzR-0004U7-9j for emacs-devel@gnu.org; Mon, 20 Sep 2021 15:30:25 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 0E16127C005B for ; Mon, 20 Sep 2021 15:30:06 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 20 Sep 2021 15:30:07 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeivddgudefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfhgfhffvufffjgfkgggtgfesth hqredttderjeenucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhsughhsehgnhhu rdhorhhgqeenucggtffrrghtthgvrhhnpeeiudfghffhjeevvedvhfffgeetleeljefffe eggfeugeegleehfeeiueejhfehgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlh hithihqdekieejfeekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehf rghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 20 Sep 2021 15:30:06 -0400 (EDT) In-reply-to: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275166 Archived-At: Jean Louis writes: > I am user and I do not expect it to work as `let' because `dlet' is > supposed to make temporarily global variables. Now it doesn't work: > > (dlet ((wrs::variables (make-hash-table :test 'equal)) > (wrs::_ (puthash "areas_name" "Hyperscope" wrs::variables))) > ) > > error: let: Symbol=E2=80=99s value as variable is void: wrs::variables > > That is IMHO wrong, as it is supposed to bind variables > dynamically: Being able to refer to variables earlier in the same binding form has nothing do with dynamic binding. `let' and `dlet' don't support that, `let*' does, and as Mattias said, there could be a `dlet*' if someone needs it. What dlet allows you is to bind variables dynamically which are no special variable (are not declared with defvar). For example: --8<---------------cut here---------------start------------->8--- (defun foo () some-var) (foo) ;; Lisp error: (void-variable some-var) (dlet ((some-var 17)) (foo)) ;=3D> 17 --8<---------------cut here---------------end--------------->8--- But instead of dlet you could just as well defvar some-var and use a normal `let' instead. Why can't you defvar wrs::variables? Or maybe it already is? In that case, you could just replace `dlet' with `let*'. Bye, Tassilo