[gambit-list] Shouldn't the make-will testator be invoked on process termination too?

Marc Feeley feeley at iro.umontreal.ca
Fri Dec 18 10:11:10 EST 2015


Will executability is determined by the garbage collector.  When the Gambit process terminates the garbage collector is not called because this would take time and it is generally useless (the whole heap is reclaimed at once).

So if you insist on the will executors to be called at the end of the program’s execution, you should call ##gc explicitly.  Note however that you may need to call ##gc more than once because a will’s executability may depend on the execution of another will.  So you’ll have to program the logic for this loop.

Marc

> On Dec 18, 2015, at 6:49 AM, Adam <adam.mlmb at gmail.com> wrote:
> 
> Marc,
> 
> Is there an outer extent on wills' applicability - why don't the second two gsc runs say OUT on termination?
> 
> Thanks,
> Adam
> 
> 
> $ gsc
> > (define a (box 1))
> > (make-will a (lambda (v) (print "OUT.\n") (force-output)))
> #<will #2>
> > (##gc)
> > (set! a #f)
> > (##gc)
> OUT.
> > ,q
> $ gsc
> > (define a (box 1))
> > (make-will a (lambda (v) (print "OUT.\n") (force-output)))
> #<will #2>
> > ,q
> $ gsc
> > (make-will (box 1) (lambda (v) (print "OUT.\n") (force-output)))
> #<will #2>
> > ,q
> $
> 




More information about the Gambit-list mailing list