Subject: Re: Extending STRING Class
From: (Rob Warnock)
Date: Thu, 21 Aug 2008 10:29:52 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
Volkan YAZICI  <> wrote:
| (Pascal J. Bourguignon) wrote:
| > (defmethod free ((self string))
| >    (remhash self *subseqs-of-string-map*)
| >    self)
| Hrm... I see. That's fine too. But AFAIK, there is no FREE in ANSI CL.
| Am I mistaken? How is FREE supposed to work?

All it does it remove the argument from the hash table, thus
removing the reference to the argument *by* the hash table that
would prevent it from being GC'd. [There may still be *other*
references to the object in your code; it's up to you to remove
or overwrite those.]

You are correct that there is no built-in FREE in CL. But
all you have to do in CL to "free" an object is remove *all*
references to the object [turning it into "garbage"], and
the GC will (eventually) come along and discover the lack of
any such references and collect the space used by the object.


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607