| It's a matter of not modifying things once constructed. CL has hooks to help do that, although a user can always get around them. A package I've been involved with lately is fset, which is available through quicklisp, or at https://github.com/slburson/fset It has some interesting features, including "functional setf expansion". This would turn something like (setf (fcar x) y) into something equivalent to (setf x (cons y (fcdr x))) (where "fcar" and "fcdr" are the same as "car" and "cdr", except when they are in a setf-able place form.) (fcar and fcdr are not in fset; I used those names just for exposition here.) It could work with nested accessors, but only if it bottoms out in a variable. |