When developing with Common Lisp, we have three possibilities to define new setf-forms:
We can define a function whose name is a list of two symbols, the first one being
setf, e.g.(defun (setf some-observable) (…)).We can use the short form of
defsetf.We can use the long form of
defsetf.We can use
define-setf-expander.
I am not sure what is the right or intended use-case for each of these possibilities.
A response to this question could hint at the most generic solution and outline contexts where other solutions are superior.
values), and to avoid computing the same thing twice, e.g. if youincfsomething in a hashtable, you shouldn’t need to hash/lookup the key twice.