Exercising this right seems a little more complicated. For example, the code for pushin SBCL 1.0.58:
(defmacro-mundanely push (obj place &environment env)
"Takes an object and a location holding a list. Conses the object onto
the list, returning the modified list. OBJ is evaluated before PLACE."
(multiple-value-bind (dummies vals newval setter getter)
(sb!xc:get-setf-expansion place env)
(let ((g (gensym)))
`(let* ((,g ,obj)
,@(mapcar
(,(car newval) (cons ,g ,getter))
,@(cdr newval))
,setter))))
Therefore, reading the documentation for get-setf-expand seems useful.
For writing, the generated code looks pretty nice:
:
(push 1 symbol)
(LET* ((#:G906 1) (#:NEW905 (CONS #:G906 SYMBOL)))
(SETQ SYMBOL #:NEW905))
SETF ( , symbol ):
(push 1 (first symbol))
(LET* ((#:G909 1)
(#:SYMBOL908 SYMBOL)
(#:NEW907 (CONS #:G909 (FIRST #:SYMBOL908))))
(SB-KERNEL:%RPLACA #:SYMBOL908 #:NEW907))
, setf, setf expansions , ( ). " " OnLisp.
: SBCL ( ), --fancy make.sh. / SBCL (, M-. Emacs + SLIME). , ( clean.sh install.sh, 90% ).