GNU bug report logs - #72344
[PATCH] Add a version of cl-once-only which handles lists of forms

Previous Next

Package: emacs;

Reported by: Thuna <thuna.cing <at> gmail.com>

Date: Sun, 28 Jul 2024 21:18:02 UTC

Severity: wishlist

Tags: patch

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

Full log


Message #77 received at 72344 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Thuna <thuna.cing <at> gmail.com>
Cc: 72344 <at> debbugs.gnu.org, spwhitton <at> spwhitton.name
Subject: Re: bug#72344: [PATCH] Add a version of cl-once-only which handles
 lists of forms
Date: Wed, 14 Aug 2024 17:29:44 +0300
> From: Thuna <thuna.cing <at> gmail.com>
> Cc: spwhitton <at> spwhitton.name, 72344 <at> debbugs.gnu.org
> Date: Wed, 14 Aug 2024 16:14:12 +0200
> 
> >> +@defmac cl-once-only* (variable forms) body
> >                                    ^^^^^
> > Shouldn't this be "forms <at> dots{}"? or maybe "form <at> 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.




This bug report was last modified 94 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.