(rontolisp) docs
← Macros

with-accessors

(with-accessors ((var accessor)...) instance body...)

Binds each var as a symbol-macro-style place standing for (accessor instance) in the body -- the accessor-call twin of with-slots. The instance form is evaluated once. Reads call the accessor, and setf/push/incf of a bound name writes through the accessor's setf place, so a class that exposes only accessors needs no slot-value.

Lite: the substitution is textual over the body (quoted data is skipped); an inner binding shadowing one of the names is still substituted.