🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Jeff Dalton Tue, 13 Oct 1992 13:40
Re: How to neatly destroy instances?
#318
Author: Jeff Dalton
Date: Tue, 13 Oct 1992 13:40
25 lines
1565 bytes
> Why do you feel a need to destroy instances explicitly?

I don't know why the original poster felt this need, but I
recently needed something in that general area, namely a way
to provide "finalization" code for when an instance was
freed by the garbage collector (or by me, I suppose).
A possible case might be a file: when I'm done with it, I
want it closed.  What I actually had was some instances
that were "handles" on objects held by another program
that I was communicating with via a pipe.  If a handle
was garbage collected, I wanted to tell the other program
to delete the corresponding object.

Some cases of this sort can be handled in the manner of
WITH-OPEN-FILE, but not all of them.

Now, one thing that didn't happen in X3J13's revision of Common
Lisp was changes to garbage collection to support such things 
as finalization and weak pointers.  I think it was reasonable
not to do this, but I want to add my voice to those saying
"we want it" in the hope that implementors will be influenced.

I'm not really sure finalization is a good idea though.

-- jd
Re: How to neatly destroy instances?
#325
Author: Simon Leinen
Date: Tue, 13 Oct 1992 15:37
23 lines
1750 bytes
In article <26235.9210131340@subnode.aiai.ed.ac.uk>
jeff@aiai.edinburgh.ac.uk (Jeff Dalton) writes:

   Now, one thing that didn't happen in X3J13's revision of Common
   Lisp was changes to garbage collection to support such things 
   as finalization and weak pointers.  I think it was reasonable
   not to do this, but I want to add my voice to those saying
   "we want it" in the hope that implementors will be influenced.

Me too! (But maybe it's too late to complain to vendors :-) Allegro CL
4.1 has "weak vectors" and finalization, the Lucid 4.1 announcement
talks about new features called "weak pointers and finalization".
(Maybe this is going to be the next major application of #+/#- :-)

   I'm not really sure finalization is a good idea though.

Why not? Let me guess: Programs that rely on finalization methods a
lot will be difficult to debug; people will use finalization where
macros like WITH-OPEN-FOO would be more appropriate... finalization
just gives you more rope to hang yourself, seems to be compatible with
the CL approach - down with Bondage-and-Discipline languages!
-- 
Simon.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads