Article View: comp.lang.clos
Article #51Deleting an Instance
From: Jon L White
Date: Thu, 30 Jul 1992 17:29
Date: Thu, 30 Jul 1992 17:29
30 lines
1753 bytes
1753 bytes
re: How can I get rid of the unnecessary instances after I've used them? By not "pointing" at them. Let the GC do it's thing. Seriously. This question is asked every 6 months or so on this mailing list, and evokes the remembrance of "destructors" in C++. But the concept of "getting rid" of something in Lisp has been around for over 30 years, and it's the same issue for "instances" as it is for CONS cells and most other objects. Howver, note that certain kinds of objects are "registered" in global places, and will not be reclaimed simply because the user has dropped all pointers to them from his code. The Common-Lisp PACKAGE system has a registry that maps strings into PACKAGE's, as well as the obvious set of mappings form strings into SYMBOL's; and CLOS obviously is mapping class-names into CLASS objects. There may be other registrations like this depending on the implementation. For example, in order to "get rid of" a symbol, you may have to call UNINTERN numerous times; and to get rid of a package, you may have to call DELETE-PACKAGE (see CLtL2). And a few CLOS implementation support a partial function for DELETE-CLASS, although this function isn't in the ANSI CL proposal (I say "partial", because depending on the class inheritance topology, this isn't always a well defined operation.) -- JonL --
Technical Details
Message-ID:
<9207301729.AA05251@kuwait.lucid>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!lucid.com!jonl%kuwaitShow Full Headers
Complete Article Headers
Newsgroups: comp.lang.clos Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!lucid.com!jonl%kuwait From: jonl%kuwait@lucid.com (Jon L White) Subject: Deleting an Instance Message-ID: <9207301729.AA05251@kuwait.lucid> Sender: daemon@cis.ohio-state.edu Organization: The Ohio State University Department of Computer and Information Science Date: Thu, 30 Jul 1992 17:29:25 GMT Lines: 31