Source
(defmethod rucksack-update-class-index ((rucksack standard-rucksack)
(class persistent-class))
(let ((old-index (rucksack-class-index rucksack class :errorp nil))
(needs-index-p (class-index class)))
(cond ((and old-index (not needs-index-p))
(rucksack-remove-class-index rucksack class :errorp t))
((and (not old-index) needs-index-p)
;; Create a class index now.
;; NOTE: If there are existing instances of this class,
;; they're *not* automatically indexed at this point.
;; (In fact, the only way to do this would be to iterate
;; over *all* objects in the rucksack, which would be rather
;; expensive. Then again, it's exactly what the garbage
;; collector does anyway, so it may be an option to have the
;; garbage collector index them automatically. But I'm not
;; sure if that's a good idea.)
(rucksack-add-class-index rucksack class :errorp t))
(t
;; We don't need to change anything
:no-change))))
Source Context