Subject: Re: R5RS vs. "In Scheme, everything is a pointer"
From: (Rob Warnock)
Date: 19 Sep 2001 02:21:35 GMT
Newsgroups: comp.lang.scheme
Message-ID: <9o8vff$kvu6e$>
Barry Margolin  <> wrote:
| Actually, a more accurate name might be "everything except small integers
| is a pointer".  Fixnums are often the only data types that can be
| implemented as immediate data, and everything else has to be "boxed".

Hah! Hardly. Try: character, booleans, the empty list, and numerous
non-standard but widely-implemented magic objects sych as #<void>,
#<undefined>, #<unbound>, and #<eof>. Some implementations even choose
to represent small *reals* as immediates!

| But as I've said before, this is purely just an optimization.

And the reverse is true, too. For example, in SIOD Scheme everything
*is* a pointer, even small ints. There, the efficiency optimization is
to cons up a range of small ints at startup (typically -100..500, or so)
and have the primitive arithmetic operators check for their results being
in that range [a quick check] and if so return the pointer to the pre-cons'd
one [also quick, if pointers to them are stored in a table].


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 ]