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.bugs Subject: bug#72344: [PATCH] Add a version of cl-once-only which handles lists of forms Date: Mon, 29 Jul 2024 16:09:41 +0900 Message-ID: <8734nsk72i.fsf@melete.silentflame.com> References: <87y15l1aj8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6920"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 72344@debbugs.gnu.org To: Thuna Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 29 09:11:17 2024 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 1sYKXM-0001dH-0f for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Jul 2024 09:11:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYKWy-0004Fa-5M; Mon, 29 Jul 2024 03:10:52 -0400 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 1sYKWw-0004FC-9H for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 03:10:50 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sYKWw-0002b9-02 for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 03:10:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=SR/taHpfhJ2t6VX5JUtaGrQNM4YaBP/AU3siCob8NUQ=; b=oOK7b3U66vnqv+5dgHWkdQ6YheRFcaIM/0L+C6Iieki+SOGH8ugPNA+jVO/parkKyEeu88wA9HLTizFm8pRx94RfB2F3HLXZOxIYv4czpvAyJn1uUzyxxGZUXH3zMxY2euJsknLCy9i74ewBENmApVTDOZmrvItJlYevIzotIEJ4bGZYgyDkoRViZq2ts68c1emytDo01j9769hgVFM7NBOvdQSQErKzr+IuM6dKUv9D6Se5BAWiP3PrBd4HYFP7V6sxCrIC2UQLiUd3Zs1LZDHs/CzHGtYs7n9Nd9deAWDPpyAYLX+I+qrOg4frJ6MHqOR+IMxrx0jB3QDd3sbA/A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sYKX7-0002fK-ST for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 03:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Jul 2024 07:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72344 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72344-submit@debbugs.gnu.org id=B72344.172223700810183 (code B ref 72344); Mon, 29 Jul 2024 07:11:01 +0000 Original-Received: (at 72344) by debbugs.gnu.org; 29 Jul 2024 07:10:08 +0000 Original-Received: from localhost ([127.0.0.1]:44801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYKWF-0002eB-OA for submit@debbugs.gnu.org; Mon, 29 Jul 2024 03:10:08 -0400 Original-Received: from sendmail.purelymail.com ([34.202.193.197]:40704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYKWD-0002dW-8t for 72344@debbugs.gnu.org; Mon, 29 Jul 2024 03:10:06 -0400 DKIM-Signature: a=rsa-sha256; b=jnBBTz2f0QLE7TiqugJGkNDmLGBemmxzhnAl3Cs4djUO+2tqsj/39yq0RNoasb1YwCY2aYoqyHpDQwJzzfniTkD0d4dzcb7fLewJuw+2mzOGrwWoKsDmkOHzsdkHYwvLIuYDS9pV0tko5VKJ18r8pc480byrZpElsf0K2Q0mU6OPN4eFPI1U1BT+gD+BHwmYz8p2kcequrUsICavneYladjypCTrP8fupAM2EKWLbIECxGVz5ubBRiN3cgl7cPqbTnLyk4p2czXpeOyHlleoSNtt4sRgplHBB8el8BqLTxOoimmelqjXfkDcpQAvO06mJSRDir+WUMG5szDE9YblTQ==; s=purelymail1; d=spwhitton.name; v=1; bh=7bhm1DjlvqTfOi9SW4kZhjHF203lid7/QuJU0JvFDvQ=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=pbuKcsvI8bzwq6w7Xf0h1LGTQZYbIueYujyE38q0jeAgckp5Obsz0XUzHJj/yuhSmTS++woRgFfnUAeM7zIBxsH3za6n0sfdHP5V4GCZiH5Ba2Z305dtvqyrByHb6pPqXhwAGWYSbIcjQtwZ8Z75n0e2S9ll/e9imOTc1VHq75lWLX7btx9+nsDC8h9AVEM0iZbmD6BRPbZWetJHHTNTNJmygQ6VzLMdFz0THB+DrWXSgTsvbZznoMTl2a3Aht9m9qmu96ZsVRCtz8k7ibRkfukxt4UmdwmYKOp/8D/zr9cp0zi+gRaknr20ihQIyVHEZGz6S05EbWn4Jqyi6CNE/Q==; s=purelymail1; d=purelymail.com; v=1; bh=7bhm1DjlvqTfOi9SW4kZhjHF203lid7/QuJU0JvFDvQ=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 72344@debbugs.gnu.org Original-Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 259145025; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 29 Jul 2024 07:09:44 +0000 (UTC) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id 911E57EE8A9; Mon, 29 Jul 2024 16:09:41 +0900 (KST) In-Reply-To: <87y15l1aj8.fsf@gmail.com> (Thuna's message of "Sun, 28 Jul 2024 23:17:31 +0200") 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:289507 Archived-At: Hello Thuna, On Sun 28 Jul 2024 at 11:17pm +02, Thuna wrote: > Attached is the macro `cl-once-only*', which takes a symbol which is > bound to a list of form (such as those contained in a `&rest args' in > `defmacro') and binds that variable to a list of symbols where each > symbol is bound to the result of evaluating (in order) the corresponding > form. The docstring provides an example which might illustrate what it > does better then I did here. > > I don't expect this to be used too often but it could be somewhat handy > in macros with a `&rest args' which are supposed to be evaluated. > > (My motivation for this is to use this macro in another patch which I > didn't want to make longer with out-of-scope additions. If this is > considered not worth polluting the `cl-' namespace over I can just write > the forms by hand so it's fine either way.) I'm the author of cl-once-only. I'm interested in macro-writing macros in the CL tradition. To be honest, cl-once-only* seems quite esoteric. Could you perhaps show me a direct comparison between some cl-once-only code and how it is made more readable by cl-once-only*? That seems to me to be the key criteria. Also, I wonder if a name like cl-list-once-only would be better. Thanks! -- Sean Whitton