From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.devel Subject: Re: master 2e9111813b: Add two classic Common Lisp macro-writing macros Date: Tue, 12 Apr 2022 08:52:39 -0700 Message-ID: <8735iiqoxk.fsf@athena.silentflame.com> References: <164974332528.14217.12591424007013368601@vcs2.savannah.gnu.org> <20220412060205.8B446C01687@vcs2.savannah.gnu.org> <87mtgqg03x.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29394"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Stefan Monnier To: Lars Ingebrigtsen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 12 17:54:44 2022 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 1neIqo-0007RP-Gd for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Apr 2022 17:54:43 +0200 Original-Received: from localhost ([::1]:53366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1neIqn-0001dm-3B for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Apr 2022 11:54:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neIox-0007vW-EU for emacs-devel@gnu.org; Tue, 12 Apr 2022 11:52:48 -0400 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:37277) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neIou-0008Oz-M8 for emacs-devel@gnu.org; Tue, 12 Apr 2022 11:52:47 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 2D7093201E88; Tue, 12 Apr 2022 11:52:42 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 12 Apr 2022 11:52:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1649778761; x=1649865161; bh=Py 8HrxKhTS+khSnoStjEiHL0SBnMIurIvSED+Fwc6ZU=; b=sDYqEde9GbkOL7hUK0 7fU8EAn7n7B/CzqDyyfjJTuWdNvLmqZtJaZ1MnVezECK+IsDLUAJaCnL7kJ22C3H n+31TyW/9YFOup+MAQ38Va1cE7mJg/CA8k2QOwmI/arY7a9jI1duWepM9HUbK5RW nXxtTALP5JdW43RCSzaCcG9zSZOUCz+dK1OkwFN+lWxcG/DTSczPodwISrv/RPFv O8+rTbzL4YlagdyZFUCWmqWM2ueYN3Ie9jkHvi/NfR6jrTzwug7+bpI3qwXs3CNP H1oKhiZGb3MIdbeqDCH6z2vppOXb2eeanSbpkq8b/gzolnSURrVg0130yNuJidXm UQlw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1649778761; x= 1649865161; bh=Py8HrxKhTS+khSnoStjEiHL0SBnMIurIvSED+Fwc6ZU=; b=R jQPsQyPKQXwyokIDJrtSudxtjO7ykCxIFeSG6cgLwpQDLv2yYI5LXp/3Hvd/EbwN ligsDcB/bdwFVrsmuxNCkXYTCb83U8U++sYr6ltnQL6YbqlaNwzap/wk2C36ePLH Bivlg0CNpDMOeSc+b70ajmg4SdOaGdSmE7tbcg190svRPiB/0dGUkNSiuEkfIraU VRlB2GVrVW3aEXK90IZx3SIxKEIkIV+xZ0cTYi4IAf+w4wx4y4pq/96hoCXiUrL0 1Mk9JXo8fF/hIZvprmZImNiKmol9TGzaeF2LwkofXsBouodDwHRR9rH/2IjfJ06r M37YyqY3KzgSeEM1RJ1Uw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudekkedgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehmtddtredtreejnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhephfdtudegjedutdekgffftdekffeiveefffejveevfeefgeek iefgtddvgeetfeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Apr 2022 11:52:41 -0400 (EDT) Original-Received: by athena.silentflame.com (Postfix, from userid 1000) id 1B34F1B77F7; Tue, 12 Apr 2022 15:52:40 +0000 (UTC) In-Reply-To: <87mtgqg03x.fsf@gnus.org> Received-SPF: pass client-ip=64.147.123.20; envelope-from=spwhitton@spwhitton.name; helo=wout4-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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:288308 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, On Tue 12 Apr 2022 at 10:46am +02, Lars Ingebrigtsen wrote: > Sean Whitton writes: > >> Add two classic Common Lisp macro-writing macros >> >> * lisp/emacs-lisp/cl-macs.el (cl-with-gensyms, cl-once-only): New ma= cros. > > Emacs now gives a lot of the following warnings when compiling -- I > haven't checked that it's due to the commit above, but I guess it's > either that or 6a480c830b. > > Warning: Eager macro-expansion skipped due to cycle: > =E2=80=A6 =3D> (load "cl-macs.el") =3D> (macroexpand-all =E2=80=A6) =3D= > (macroexpand (cl-psetq =E2=80=A6)) =3D> (load "cl-macs.el") > Warning: Eager macro-expansion skipped due to cycle: > =E2=80=A6 =3D> (load "cl-macs.el") =3D> (macroexpand-all =E2=80=A6) =3D= > (macroexpand (cl-psetq =E2=80=A6)) =3D> (load "cl-macs.el") > ELC calendar/diary-lib.elc > ELC calendar/holidays.elc > Warning: Eager macro-expansion skipped due to cycle: Here is the fix. I'll be at a machine where I can install it later today, or someone else can sooner. Apologies again! --=20 Sean Whitton --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-eager-macroexpansion-cycle-in-cl-once-only.patch >From f467478832a9041017653a07619acfdb9406ad99 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 12 Apr 2022 08:48:18 -0700 Subject: [PATCH] Fix eager macroexpansion cycle in cl-once-only * lisp/emacs-lisp/cl-macs.el (cl-once-only): Use different cl-loop syntax, with no functional change, but such that the loop does not expand into cl-psetq. --- lisp/emacs-lisp/cl-macs.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index af8855516c..364b5120a0 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2473,11 +2473,11 @@ cl-once-only ;; We require this explicit call to `list' rather than using ;; (,,@(cl-loop ...)) due to a limitation of Elisp's backquote. `(let ,(list - ,@(cl-loop for name in names and gensym in our-gensyms + ,@(cl-loop for name in names for gensym in our-gensyms for to-eval = (or (cadr name) (car name)) collect ``(,,gensym ,,to-eval))) ;; During macroexpansion, bind each NAME to its gensym. - ,(let ,(cl-loop for name in names and gensym in our-gensyms + ,(let ,(cl-loop for name in names for gensym in our-gensyms collect `(,(car name) ,gensym)) ,@body))))) -- 2.30.2 --=-=-=--