(rontolisp) docs
← Macros

with-slots

(with-slots (slot-or-pair...) instance body...)

Binds variables to the slot values of a CLOS-subset instance (defclass / define-condition) for the body: each entry is a slot name, or a (var slot) pair binding var to slot slot. The instance form is evaluated once. Expands into a let over slot-value reads.

Lite (read-only): Common Lisp's with-slots binds symbol macros so assignment writes back to the slot; here the bindings are plain variables, so setq/setf of one assigns the local only. Covers the dominant read-side use, e.g. condition :report lambdas.