Q: how do I teach setf
about new places it can set?
In common lisp, one uses the
macro defsetf
to tell
setf
about new places it can set.
In elisp, that macro exists in in the cl
library, but, as far as
I can tell, has not been ported into the updated cl-lib
library.
However,
we're not supposed to use the old cl
library:
Since the old
cl.el
does not use a clean namespace, Emacs has a policy that packages distributed with Emacs must not loadcl
at run time. (It is ok for them to loadcl
at compile time, witheval-when-compile
, and use the macros it provides.) There is no such restriction on the use ofcl-lib
. New code should usecl-lib
rather thancl
.
Does defsetf
(or a substitute) exist somewhere else? How else
should I tell setf
about new places?