Macro with-resolved-places (&rest bindings) &body bodyresults

Each binding is of the form (resolved-place unresolved-place).

At the time with-resolved-places is entered, the subforms of each unresolved-place are evaluated and bound to their temporary variables. Within body (an implicit progn), each resolved-place can be used to access (read and/or write) the corresponding unresolved-place, perhaps repeatedly, without evaluating the subforms again.

(let* ((my-list (list 0 1 2))
       (my-other-list my-list))
  (with-resolved-places ((second (second (princ my-list))))
    (setf my-list nil second 8)
    (incf second 2)
    (list my-list my-other-list second)))

  -| (0 1 2)
  ⇒ (NIL (0 10 2) 10)

CLHS Evaluation of Subforms to Places

In the absence of with-resolved-places, in situations where multiple evaluation of subforms for different accesses is not desirable, one would traditionally bind the results of the evaluation of the troublesome subforms (with let or let*) in an ad-hoc way on an as-needed basis, manually replicating part of the job of setf expanders.