sperber(a)informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor]) writes:
Currently, weak lists are implemented as a special object around an
ordinary list which can be extracted via the `weak-list-list'
procedure. This exposes the internal representation of weak lists to
a degree so as to make proper generic handling in the GC difficult, so
we'd like to discuss changing it.
The simplest way to implement weak lists would be to just make them a
regular cons of a weak pointer (a more primitive object) and a weak
list, and have special accessors `weak-list-car' and `weak-list-cdr'.
`weak-list-car' looks for a live list cons, and performs some cleanup
work on the way. Possibly another thin layer above this for looping
would get us even further.
if "weak list" means what I think it means (i.e. a list built with
objects that behave like regular conses but don't hold on to their
cars), then a nice alternative would be to use the Chez Scheme
solution:
absolutely regular conses, but allocated in a separate space, so that
the GC knows they are special.
well, you are most probably aware of that, but just in case.
--
SIGTHTBABW: a signal sent from Unix to its programmers at random
intervals to make them remember that There Has To Be A Better Way.
-- Erik Naggum