[Openmcl-devel] Termination

Zach Beane xach at xach.com
Thu Feb 4 08:51:37 PST 2010


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?

Zach



More information about the Openmcl-devel mailing list