(rontolisp) docs
← cl Package Functions

make-load-form-saving-slots

(make-load-form-saving-slots object &key slot-names environment)

The ready-made make-load-form answer: a form that rebuilds the object with its slot values as they are now. A method that has nothing special to say delegates to it, which is what cl-ppcre's charmap and charset methods do.

The form it returns is the internal instance constructor — the same one the compiler writes out for an instance with no method at all — so delegating to it asks for the built-in behavior explicitly rather than changing it.

Lite: :slot-names is ignored — every slot travels — and :environment is accepted and unused. The object is rebuilt in one step rather than allocated and then filled, so it cannot carry a reference back to itself. A slot holding something the compiler cannot write out (a hash table, a stream) still fails the compile; a method that must skip such a slot builds its own form instead.