GNU bug report logs - #77058
[PATCH] Add cl-with-accessors

Previous Next

Package: emacs;

Reported by: Okamsn <okamsn <at> protonmail.com>

Date: Sun, 16 Mar 2025 18:25:02 UTC

Severity: normal

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#77058: closed ([PATCH] Add cl-with-accessors)
Date: Mon, 31 Mar 2025 18:45:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 31 Mar 2025 14:44:29 -0400
with message-id <jwv34ett58s.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#77058: [PATCH] Add cl-with-accessors
has caused the debbugs.gnu.org bug report #77058,
regarding [PATCH] Add cl-with-accessors
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
77058: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77058
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Okamsn <okamsn <at> protonmail.com>
To: Emacs Bugs List <bug-gnu-emacs <at> gnu.org>
Subject: [PATCH] Add cl-with-accessors
Date: Sun, 16 Mar 2025 18:23:25 +0000
[Message part 3 (text/plain, inline)]
Hello,

The attached patch adds the macro `cl-with-accessors'.  This macro uses 
`cl-symbol-macrolet' to treat a symbol like a use of an accessor 
function, such as those made by `cl-defstruct' and `cl-defclass'. This 
can be helpful when using repeated calls to read and write with the 
functions.

It is based on the description at
https://www.lispworks.com/documentation/HyperSpec/Body/m_w_acce.htm

Also, in the test `cl-lib-struct-accessors' in 
test/lisp/emacs-lisp/cl-lib-tests.el, it checks for the keyword 
`:readonly', but the documented keyword is `:read-only'.  Is this a 
typo, or was this intentional?

Thank you.
[0001-Add-cl-with-accessors.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: okamsn <at> protonmail.com
Cc: Eli Zaretskii <eliz <at> gnu.org>, Daniel Colascione <dancol <at> dancol.org>,
 77058-done <at> debbugs.gnu.org
Subject: Re: bug#77058: [PATCH] Add cl-with-accessors
Date: Mon, 31 Mar 2025 14:44:29 -0400
>> +                 (_
>> +                  (error "Malformed `cl-with-accessors' binding: %s" b))))
>
> This should be `%S` rather than `%s`.

I just pushed your patch to `master`, with the above change (and with
the test moved to `cl-macs-tests.el` where the surrounding tests have
been moved recently).

Thanks, closing,


        Stefan



This bug report was last modified 50 days ago.

Previous Next


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