[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: no constants please



Richard Kelsey <kelsey@xxxxxxx> writes:

> Are there any implementations of Scheme in use where SCHEME_FALSE,
> SCHEME_TRUE, SCHEME_NULL, or SCHEME_UNSPECIFIC should be freshly
> allocated?  Or where EQ? and == are not equivalent?  (These are not
> rhetorical questions; I really would like to know -- is this an
> existing or only potential problem for portability?)

It is a known strategy for more complex memory systems to have a
variety of different values for certain constants.  

If your memory is segregated into a bunch of separate heaps (some of
which might even be detachable from the system), and you also have
decided that every value will be boxed (an independently useful idea),
then it is now a huge advantage to try and reduce inter-heap pointers.

One very category of inter-heap pointers is pointers from a heap to
constants such as #f, small integers, or characters.  So instead, you
let each heap have its own #f, and you hide the complexity inside
eq?.  

Thomas