Subject: Re: generational gc and large root set
From: (Rob Warnock)
Date: 17 Jan 2002 04:25:25 GMT
Newsgroups: comp.lang.scheme
Message-ID: <a25jnl$4a2nr$>
Jeffrey Siegal  <> 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 Warnock, 30-3-510		<>
SGI Network Engineering		<>
1600 Amphitheatre Pkwy.		Phone: 650-933-1673
Mountain View, CA  94043	PP-ASEL-IA

[Note: and aren't for humans ]