14
free-pile
'()
/
add-recycled
;; this is used to register the object with the recyclery so it can be given
;; out later.
(method (obj) (set free-pile (set-add obj free-pile)))
/
add-parent
(method (p) (if (and (= caller $recycler) (not (= this $recycler)))
	        (#0:addparent p)
                (raise E_PERM "cannot change that object's parents")))
/
get-free
;; this checks to see if there are any available recycled object to re-use
(method (parent) (if (not free-pile) 0
	           (var i (begin
			     (set i (car free-pile))
		             (set free-pile (cdr free-pile))
			     (i:add-parent parent)
			     (i:remove-parent this)
			     i))))
/
/
/+++++++++ end of object #15 ... no lines after this ++++++++++