[Openmcl-devel] Termination

Ron Garret ron at flownet.com
Thu Feb 4 09:05:46 PST 2010


On Feb 4, 2010, at 8:51 AM, Zach Beane wrote:

> Ron Garret <ron at flownet.com> writes:
> 
>> Doesn't seem to work for me:
>> 
>> ? (defclass foo () ())
>> #<STANDARD-CLASS FOO>
>> ? (defvar *dead-foo-count* 0) 
>> *DEAD-FOO-COUNT*
>> ? (defmethod ccl::terminate ((f foo)) (incf *dead-foo-count*))
>> #<STANDARD-METHOD TERMINATE (FOO)>
>> ? (dotimes (i 1000) (make-foo))
>> NIL
>> ? (gc)
>> NIL
>> ? *dead-foo-count*
>> 0
>> ? (dotimes (i 10000000) (make-foo))
>> NIL
>> ? (gc)
>> NIL
>> ? *dead-foo-count*
>> 0
>> 
>> Am I doing something wrong or is this a bug?
> 
> Do you need to use http://l1sp.org/ccl/terminate-when-unreachable first
> for this to work as expected?

Yep.  That's it.  Thanks!

rg




More information about the Openmcl-devel mailing list