i created the weak list interface originally, and i see your problem. you
really want to create only one primitive "weak" interface, and implement weak-*
on top of that.
btw i just looked at Java's Reference class, and noticed that it [naturally]
implements the kitchen sink of primitive weak-reference interfaces. if you plan
on implementing all of that, have fun!
http://java.sun.com/products/jdk/1.2/docs/api/java/lang/ref/package-summa...
anyway, how about hrvoje's last suggestion? maintain a parallel normal list,
and allow applications to access it with weak-list-list and then do what you
want with it. lazy updating as hrvoje suggests would be the best, but if you
can't do that efficiently, then add a set-weak-list-dirty primitive. this seems
like the only api change you might have to make to weak lists.
"Michael Sperber [Mr. Preprocessor]" wrote:
As many of you know, Richard Reingruber (primarily) and I are working
on making the GC in XEmacs replaceable. Right now, Richard is working
on simplifying XEmacs's data representation to make this easier. One
particular issue requires a policy decision to handle right: weak
lists.
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.
Doing would get rid of quite a bit of implementation complexity in
XEmacs.
As to the present code base which uses weak lists:
- *No* Lisp code presently.
- Simple weak lists for extend children and frame subwindows which
would be very easy to convert.
- Specifier alists for windows, a really awkward case which would
involve somewhat more special-casing as is the case presently.
Are there any objections to this change in principle?
(Note that all of this work is presently happening on a branch---we'd
just like to discuss issues such as this one to avoid having to revert
them later.)
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
--
ben
I'm sometimes slow in getting around to reading my mail, so if you
want to reach me faster, call 520-661-6661.
See
http://www.666.com/ben/chronic-pain/ for the hell I've been
through.