From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72344: [PATCH] Add a version of cl-once-only which handles lists of forms Date: Wed, 14 Aug 2024 17:29:44 +0300 Message-ID: <86jzgj89ev.fsf@gnu.org> References: <87y15l1aj8.fsf@gmail.com> <8734nsk72i.fsf@melete.silentflame.com> <87plqw0y9j.fsf@gmail.com> <87ikwi5neo.fsf@melete.silentflame.com> <871q35mdrd.fsf@gmail.com> <871q321l7d.fsf@melete.silentflame.com> <874j7xzvgx.fsf@gmail.com> <87r0b1su7p.fsf@melete.silentflame.com> <874j7o2kcq.fsf@gmail.com> <87zfpg3r4q.fsf@melete.silentflame.com> <87v80326ab.fsf@gmail.com> <86mslffxfj.fsf@gnu.org> <87o75vi43v.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3617"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72344@debbugs.gnu.org, spwhitton@spwhitton.name To: Thuna Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 14 16:30:49 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 1seF1U-0000mk-Ks for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Aug 2024 16:30:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1seF1D-0006uu-Rr; Wed, 14 Aug 2024 10:30:33 -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 1seF19-0006l5-Nm for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 10:30:27 -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 1seF19-0004qZ-Dz for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 10:30:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=b7MWHZWlSqrSTrP9qG3sAMVXQ09AFO4sXl1mkIv70kk=; b=QcYhxwxisEYGHQEocdR97hDrxamEhzoIGSDZgJsGyMeHTidZfYvZ1HvJAhETaHhLoL9AvyoZ90KCEigfm2RrbkT1Fvp4zc8FLmv9g+0LEToiujk5Mn+twQla9h3/w6vo503f1zUUb5PKyMMNI/BmKNUlby+ltVKLEXZTKmVUkhF6yWJjy38IMqxaCIdc8n3i/7r7qT3j27Tqw4xCVVUmycx0lNVEmkGJmYqmQR6iIzJAWTSYXJHGFv+/pV+6l9pEdAVFMMLd6QDj6qw9lG2SEO2oxQqa7n2UIhamnFcIgdsUCIzvVgyhncfJ42BRHV2GD4DAsqIqOw83rUNnPxtPzQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1seF1i-0006X5-0E for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 10:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Aug 2024 14:31: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.172364583125050 (code B ref 72344); Wed, 14 Aug 2024 14:31:01 +0000 Original-Received: (at 72344) by debbugs.gnu.org; 14 Aug 2024 14:30:31 +0000 Original-Received: from localhost ([127.0.0.1]:47192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1seF1D-0006Vy-Am for submit@debbugs.gnu.org; Wed, 14 Aug 2024 10:30:31 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1seF1B-0006Vg-KJ for 72344@debbugs.gnu.org; Wed, 14 Aug 2024 10:30:30 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1seF0W-0004bZ-Vy; Wed, 14 Aug 2024 10:29:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=b7MWHZWlSqrSTrP9qG3sAMVXQ09AFO4sXl1mkIv70kk=; b=pNwMZeEVX5FK XMocxodAUmiCAD77YSXK9FngppDv/2TWYQhCrNmZRbu98EdpNb/jbDsVrNghdaXHCF4vPAy8eOwhj yQ3ZigK/NEOuhOk2k+TmRgOPUjeeQRLwRMZYw+F8KZeJmVfXqsuKOpRXjojvQEbrR8eFekJkNcaJ5 7l2EYn1KONuQubQF4aqckIz2Jzq/qtFmeMXqEPP6tB5dk5F5aVfc6z6ONhmMyP93xA/6oYMezoc4K EXF+AMLbZkF+4GrJJUXZk6BTH60gD3YZUVqXbqLoRS9OyBuaZ6SVhTbDJkS3Z+dHPrXpKsaayupin 7vkJVzuF7M9FR94e+cNCyw==; In-Reply-To: <87o75vi43v.fsf@gmail.com> (message from Thuna on Wed, 14 Aug 2024 16:14:12 +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:290146 Archived-At: > From: Thuna > Cc: spwhitton@spwhitton.name, 72344@debbugs.gnu.org > Date: Wed, 14 Aug 2024 16:14:12 +0200 > > >> +@defmac cl-once-only* (variable forms) body > > ^^^^^ > > Shouldn't this be "forms@dots{}"? or maybe "form@dots{}"? > > No, it is "forms", which is evaluated to obtain a list of forms, each of > which is individually analogous to "form" in `cl-once-only' as used in > the info. Maybe I have failed to communicate this properly. Would an > example like > > (cl-defmacro foo ((&rest optforms) body &rest forms) > (cl-once-only* (all-forms (append optforms forms)) ...)) > > help? Not really. What is missing is the explicit statement that FORMS is evaluated to yield a list of forms. (Btw, why is it called "FORMS", plural, when it is actually a single form that yields a list of forms only when evaluated?). The text you wrote: +Each element of @var{variable} may be used to refer to the result of +evaluating the corresponding form in @var{forms} within @var{body}. doesn't mention that FORMS is evaluated, and makes it sound like FORMS includes several forms to begin with ("corresponding form in FORMS"). This is in direct contradiction with what you explained now, and therefore this text needs to be amended. Thanks.