Article View: comp.lang.clos
Article #318Re: How to neatly destroy instances?
From: Jeff Dalton
Date: Tue, 13 Oct 1992 13:40
Date: Tue, 13 Oct 1992 13:40
25 lines
1565 bytes
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
Technical Details
Message-ID:
<26235.9210131340@subnode.aiai.ed.ac.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!aiai.edinburgh.ac.uk!jeffShow Full Headers
Complete Article Headers
Newsgroups: comp.lang.clos Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!aiai.edinburgh.ac.uk!jeff From: jeff@aiai.edinburgh.ac.uk (Jeff Dalton) Subject: Re: How to neatly destroy instances? Message-ID: <26235.9210131340@subnode.aiai.ed.ac.uk> Sender: daemon@cis.ohio-state.edu Organization: The Ohio State University Department of Computer and Information Science Date: Tue, 13 Oct 1992 13:40:40 GMT Lines: 25