; class of temporary objects (defclass temporary (is-a USER) (role abstract) ; T "--- temporary object (will be deleted during garbage cleaning) ; F "--- permanent object (slot temporary (type SYMBOL) (allowed-symbols T F) (default T)) (message-handler delete-tmps) ) (defmessage-handler temporary delete-tmps() (if (eq ?self:temporary T) then (send ?self delete)) ) ; remove all temporary object from memory (deffunction clear-temporary-garbage() (do-for-all-instances ((?x temporary)) (send ?x delete-tmps)) (return) )