On 10 Jun 2002, Chris Baker wrote:
> > Chris Baker <[EMAIL PROTECTED]> writes: > > [...] > > > > On a related note, why can't the FUNCTION argument to EXT:FINALIZE > > > take one argument that is the object (or a reference to it) being > > > finalized? Is this impossible? It would make it much easier for the > > > programmer (or for me at least)... > > > > The thing that you're finalizing has already been deallocated by the > > time your function is called (that's how the function that calls it > > knows to call it) so it can't be passed in. > > Of course, you could always define your own finalize which does what > you ask: > > (defun my-finalize (obj callback) > (finalize (list obj) > #'(lambda () > (funcall callback obj)))) > > No. The list becomes garbage immediately, but that doesn't prove anything about whether or not obj is garbage. You don't get access to the object in the finalize callback because if you could, it wouldn't be garbage :) Tim
