Lisp HUG Maillist Archive

Garbage collection of symbols

I'm porting a large legacy application to LispWorks which makes heavy
use of symbols and symbol property lists.  I'd like to know if and
when symbols themselves are GC'd by LW.  Does it suffice if they are
no longer accessible (from a package or from some other data
structure)?  Will a non-empty property list prevent the symbol from
being GC'd?  Aynthing else to watch out for?

Thanks,
Edi.


Re: Garbage collection of symbols

Unable to parse email body. Email id is 4087

Re: Garbage collection of symbols

On 1 Jul 2005, at 14:06, Martin Simmons wrote:

>>>>>> On Fri, 01 Jul 2005 12:57:50 +0200, Edi Weitz <edi@agharta.de>  
>>>>>> said:
>>>>>>
>
>   Edi> I'm porting a large legacy application to LispWorks which  
> makes heavy
>   Edi> use of symbols and symbol property lists.  I'd like to know  
> if and
>   Edi> when symbols themselves are GC'd by LW.  Does it suffice if  
> they are
>   Edi> no longer accessible (from a package or from some other data
>   Edi> structure)?  Will a non-empty property list prevent the  
> symbol from
>   Edi> being GC'd?  Aynthing else to watch out for?
>
> Yes, symbols will garbage collected if they are no longer  
> accessible and
> property lists will not affect this.

Aren't interned symbols always accessible, in the sense that whenever  
you read in some s-expression, it can contain such symbols? I would  
expect symbol values, functions and property lists to remain so that  
I can later "rediscover" them.

Am I missing something?


Pascal

--
2nd European Lisp and Scheme Workshop
July 26 - Glasgow, Scotland - co-located with ECOOP 2005
http://lisp-ecoop05.bknr.net/



Re: Garbage collection of symbols

On Fri, 1 Jul 2005 18:49:37 +0200, Pascal Costanza <pc@p-cos.net> wrote:

> Aren't interned symbols always accessible, in the sense that
> whenever you read in some s-expression, it can contain such symbols?
> I would expect symbol values, functions and property lists to remain
> so that I can later "rediscover" them.
>
> Am I missing something?

CL-USER 1 > (defun foo () 42)
FOO

CL-USER 2 > (funcall (read-from-string "FOO"))
42

CL-USER 3 > (unintern 'foo)
T

CL-USER 4 > 1
1

CL-USER 5 > 2
2

CL-USER 6 > 3
3

CL-USER 7 > (mark-and-sweep 2)
2933352
3575808

CL-USER 8 > (funcall (read-from-string "FOO"))

Error: Undefined function FOO called with arguments ().
  1 (continue) Try invoking FOO again.
  2 Return some values from the call to FOO.
  3 Try invoking something other than FOO with the same arguments.
  4 Set the symbol-function of FOO to another function.
  5 (abort) Return to level 0.
  6 Return to top loop level 0.

Type :b for backtrace, :c <option number> to proceed,  or :? for other options

CL-USER 9 : 1 > 


Updated at: 2020-12-10 08:52 UTC