|
From: | felix winkelmann |
Subject: | Re: [Chicken-users] Finalizers |
Date: | Tue, 20 Jun 2006 15:42:48 +0200 |
On 6/20/06, John Cowan <address@hidden> wrote:
Either I seriously don't understand finalizers or else they don't work in simple cases. Here's a log: Version 2, Build 320 - windows-cygwin-x86 - [ dload ptables applyhook ] (c)2000-2006 Felix L. Winkelmann #;1> (define x '(1 2 3)) #;2> (define (yammer x) (print x " is dead")) #;3> (set-finalizer! x yammer) (1 2 3) #;4> (gc #t) 157812 #;5> (define x #f) #;6> (gc #t) 157812 #;7> Why is nothing reclaimed, and why isn't "(1 2 3) is dead" printed?
The literal list is held in the interpreter history, because it is the result value of the set-finalizer! call. Running this in a normal program will work fine. cheers, felix
[Prev in Thread] | Current Thread | [Next in Thread] |