Is it possible to have an object X so that some function gets called when X is gc-ed?<br><br>Suppose I have something like<br><br>(define-type foo ...)<br>(define bar (foo-create ...))<br><br>and inside of bar, there's a C-land resource that I want to have freed up when bar is GC-ed;<br>
<br>Is there a way to have some function like (foo-gc) s.t. when bar is GC-ed, <br>(foo-gc bar) is called?<br><br>Thanks!<br>