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


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

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 1 (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)]

This bug report was last modified 51 days ago.

Previous Next


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