Subject: Re: generational gc and large root set
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 17 Jan 2002 04:25:25 GMT
Newsgroups: comp.lang.scheme
Message-ID: <a25jnl$4a2nr$1@fido.engr.sgi.com>
Jeffrey Siegal  <jbs@quiotix.com> wrote:
+---------------
| Rob Warnock wrote:
| > It's important not to collect *either* the symbol "foo"[1] or
| > the global variable named by it between the two "eval" calls,
| > or the 2nd "foo" will get an "undefined variable" error.
| 
| No, you can't collect foo because it is referenced by the constant in 
| the text of the program (second call to eval; the constant in the first 
| call to eval can be collected because it won't be referenced again.
+---------------

But by the definition of a "symbol" in Scheme (or Lisp), those "two"
constants must be the same *single* object after the code has been
read in -- that's what "interning" is all about --  thus you can't
collect it (sic -- "it", not "them"). You can certainly collect the
code that *references* it (e.g, the first "eval"), but you can't
collect the symbol itself (or the global it names).

To say it another way, the "foo" in the first "eval" *must* be "eq?"
to the "foo" in the second "eval", since there's only one symbol object
there (albeit with [at least] two references).


-Rob

-----
Rob Warnock, 30-3-510		<rpw3@sgi.com>
SGI Network Engineering		<http://www.meer.net/~rpw3/>
1600 Amphitheatre Pkwy.		Phone: 650-933-1673
Mountain View, CA  94043	PP-ASEL-IA

[Note: aaanalyst@sgi.com and zedwatch@sgi.com aren't for humans ]