[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] newbie: questions about set-finalizer!
From: |
felix winkelmann |
Subject: |
Re: [Chicken-users] newbie: questions about set-finalizer! |
Date: |
Tue, 16 Dec 2008 19:36:05 +0100 |
On Mon, Dec 15, 2008 at 11:57 PM, Alejandro Forero Cuervo
<address@hidden> wrote:
>
> I have a question about finalizers.
>
> If you run the following in csi:
>
> (define x (list 1 2 3))
> (begin (set-finalizer! x (lambda (o) (format #t "Delete: ~A~%" o))) #t)
> (define y (list 4 5 6))
> (begin (set-finalizer! y (let ((p x)) (lambda (o) (format #t "Delete: ~A:
> ~A~%" o p)))) #t)
> (gc #t)
> (set! x #f)
> (gc #t)
>
> Why do you get "Delete: (1 2 3)", the output of the finalizer for x,
> even though the finalizer for y depends on the value of x?
>
> Am I misunderstanding the way finalizer procedures get executed?
>
A bug. The finalizer itself is not considered in the calculation whether
something is still referenced or not (I think). I have to investigate.
cheers,
felix
- [Chicken-users] newbie: foreign pointers that depend on Scheme objects, Alejandro Forero Cuervo, 2008/12/15
- [Chicken-users] newbie: questions about set-finalizer!, Alejandro Forero Cuervo, 2008/12/15
- Re: [Chicken-users] newbie: questions about set-finalizer!,
felix winkelmann <=
- Re: [Chicken-users] newbie: questions about set-finalizer!, felix winkelmann, 2008/12/17
- Re: [Chicken-users] newbie: questions about set-finalizer!, Alejandro Forero Cuervo, 2008/12/20
- Re: [Chicken-users] newbie: questions about set-finalizer!, felix winkelmann, 2008/12/21
- Re: [Chicken-users] newbie: questions about set-finalizer!, felix winkelmann, 2008/12/22
- Re: [Chicken-users] newbie: questions about set-finalizer!, felix winkelmann, 2008/12/22
Re: [Chicken-users] newbie: foreign pointers that depend on Scheme objects, felix winkelmann, 2008/12/18