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: 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 <at> debbugs.gnu.org
Subject: bug#77058: [PATCH] Add cl-with-accessors
Date: Sun, 30 Mar 2025 12:57:38 -0400
>> You could get away from the need for compile-time visible of classes
>> by switching from cl-symbol-macrolet to a custom expander function
>> (which is how cl-symbol-macrolet itself is implemented), but I was
>> too lazy.

I don't think this comment by Daniel was about your code but about his.
At least, AFAICT, your code already does not need compile-time
visibility of classes (it's not even specific to classes at all).

> I wrote `cl-with-accessors' with `cl-symbol-macrolet' because the 
> definition at http://clhs.lisp.se/Body/m_w_acce.htm used 
> `symbol-macrolet'.  Do you believe that it should be done differently or 
> be more like what you wrote?

While it's often simpler to forgo `cl-macrolet` and directly call
`macroexpand-all` instead, the implementation of `cl-symbol-macrolet` is
significantly more delicate, so the use of `cl-symbol-macrolet` is the
right choice here.

> +                 (_
> +                  (error "Malformed `cl-with-accessors' binding: %s" b))))

This should be `%S` rather than `%s`.


        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.