by pfdietz · 2y ago · 0 comments
Suppose we have a pure cons type, call it PCONS, with accessors PCAR and PCDR. Then, the form
(setf (pcar (pcdr x)) y)
turns into (effectively; the actual expansion has temporary variables to avoid duplicating forms)
(progn (setq x (pcons (pcar x) (pcons y (pcdr (pcdr x))))) y)