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: Tue, 21 Sep 2021 08:31:31 +0200 Message-ID: <878rzqtopk.fsf@gnu.org> References: <83wnp5m9i5.fsf@gnu.org> <87y27rhwp0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15950"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.6; emacs 28.0.50 Cc: emacs-devel@gnu.org To: Jean Louis Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 21 08:43:43 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 1mSZVH-0003y8-AM for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Sep 2021 08:43:43 +0200 Original-Received: from localhost ([::1]:59942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSZVG-0000KS-2r for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Sep 2021 02:43:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSZTU-0007Ms-Hc for emacs-devel@gnu.org; Tue, 21 Sep 2021 02:41:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59562) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSZTT-0001Ak-S5; Tue, 21 Sep 2021 02:41:51 -0400 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:37657) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSZTR-0001iM-2s; Tue, 21 Sep 2021 02:41:51 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 6E98D27C0054; Tue, 21 Sep 2021 02:41:48 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 21 Sep 2021 02:41:48 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeifedguddutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfhgfhffvufffjgfkgggtsehttd ertddtredtnecuhfhrohhmpefvrghsshhilhhoucfjohhrnhcuoehtshguhhesghhnuhdr ohhrgheqnecuggftrfgrthhtvghrnhepveevieekteekveeigfefffeivdetgeduvdffue euudevgedttdehvdfhueevfffhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhepthhhohhrnhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlih hthidqkeeijeefkeejkeegqdeifeehvdelkedqthhsughhpeepghhnuhdrohhrghesfhgr shhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 21 Sep 2021 02:41:47 -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:275198 Archived-At: Hi Jean, >> Why can't you defvar wrs::variables? Or maybe it already is? In >> that case, you could just replace `dlet' with `let*'. > > Thanks Tassilo for the tip, though I have tried to use `defvar' and > `let*' and that does not work in my case. I cannot technically explain > it why. Practically, lexical binding script is calling in my case > dynamical binding function. > > By using `defvar' and subsequently `let*' I can avoid the first error. > > I cannot however get the variables to pass over to the function in > dynamical binding script `rcd-template-eval' that is supposed to work > with variables. > > This worked with `dlet' before, not it does not work. > > Developer changed `dlet' to fit whatever programming habits, but > deleted the functionality of `dlet*' > > I really need it. > > rcd-template-eval: `eval' error: (void-variable languages_extension) > for match: 'languages_extension'rcd-template-eval: `eval' error: > (void-variable areas_id) for match: 'areas_id'rcd-template-eval: >From that error, I assume you now have code like this: (let* ((wrs::variables ...) (languages_extension (gethash "languages_extension" wrs::variables)) (area_id (gethash "area_id" wrs::variables))) (do-stuff)) where the binding of languages_extension and area_id can access the new value of the defvar wrs::variables (because of let*) but languages_extension and area_id are only bound lexically (because they are not defvar-ed and should not because of their missing prefix) meaning they are bound only in the body of this `let*' (lexically!) but not in `do-stuff' when it is called in this `let*'s body. So for those, you really need dlet. Assuming that area_id never depends on the value of languages_extension etc, you probably can use (defvar wrs::variables nil) (let ((wrs::variables ...)) (dlet ((languages_extension (gethash "languages_extension" wrs::variables)) (area_id (gethash "area_id" wrs::variables))) (do-stuff))) Bye, Tassilo