From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.bugs Subject: bug#59333: [PATCH] Define macro dlet* Date: Sat, 19 Nov 2022 07:47:16 +0300 Message-ID: References: <0e8ca5ce-a413-0dd0-c62e-647d19953a3b@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31924"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.7+37 (a90f69b) (2022-09-02) Cc: 59333@debbugs.gnu.org To: daanturo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 19 05:48:27 2022 Return-path: Envelope-to: geb-bug-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 1owFmF-00085V-NF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Nov 2022 05:48:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owFlt-0002gZ-Lz; Fri, 18 Nov 2022 23:48:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owFlq-0002fp-E7 for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 23:48:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owFlq-0003U9-63 for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 23:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1owFlq-0002OQ-2Q for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 23:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jean Louis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Nov 2022 04:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59333 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59333-submit@debbugs.gnu.org id=B59333.16688332609055 (code B ref 59333); Sat, 19 Nov 2022 04:48:02 +0000 Original-Received: (at 59333) by debbugs.gnu.org; 19 Nov 2022 04:47:40 +0000 Original-Received: from localhost ([127.0.0.1]:38691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owFlT-0002Ly-Es for submit@debbugs.gnu.org; Fri, 18 Nov 2022 23:47:39 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:44517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owFlR-0002Lh-LP for 59333@debbugs.gnu.org; Fri, 18 Nov 2022 23:47:38 -0500 Original-Received: from localhost ([::ffff:197.239.5.174]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000F6134.0000000063785FE9.00000D48; Fri, 18 Nov 2022 21:47:37 -0700 Content-Disposition: inline In-Reply-To: <0e8ca5ce-a413-0dd0-c62e-647d19953a3b@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248295 Archived-At: * daanturo [2022-11-17 10:16]: > --=-=-= > Content-Type: text/plain > > Tags: patch > > > The dlet breakage comes as much surprise to me. There's not even a > single entry in NEWS that mentions it. If I remember well, `dlet' was working just fine (as in the sense of dlet*), and then because it was changed and made `dlet' behave not in the sense of `dlet*', it did not work any more for me, so I have renamed the old dlet, to my private function `rcd-dlet' to fix it's behavior when developers changed the last line. The last line of `dlet' is now: (let ,binders ,@body))) while I need it to be as below: (let* ,binders ,@body))) (defmacro rcd-dlet (binders &rest body) "Like `let*' but using dynamic scoping. Argument BINDERS behaves similarly like `let' with the difference that variables become global even under lexical scope. Optional argument BODY will be executed." (declare (indent 1) (debug let)) ;; (defvar FOO) only affects the current scope, but in order for ;; this not to affect code after the main `let' we need to create a new scope, ;; which is what the surrounding `let' is for. ;; FIXME: (let () ...) currently doesn't actually create a new scope, ;; which is why we use (let (_) ...). `(let (_) ,@(mapcar (lambda (binder) `(defvar ,(if (consp binder) (car binder) binder))) binders) (let* ,binders ,@body))) -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/