Subject: bug#77058: [PATCH] Add cl-with-accessors

From: Stefan Monnier <[email-masked]>
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