(defun make-persistent-data (class contents
&optional (rucksack (current-rucksack)))
(let ((object (make-instance class
:contents contents
:rucksack rucksack))
(cache (and rucksack (rucksack-cache rucksack))))
(when cache
(let ((object-id (cache-create-object object cache)))
;; Q: What about the transaction-id slot?
;; Do we need to set that too?
(setf (slot-value object 'object-id) object-id)))
object))
Source Context