sperber(a)informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor]) writes:
>>>>> "Hrvoje" == Hrvoje Niksic
<hniksic(a)arsdigita.com> writes:
Hrvoje> sperber(a)informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor])
writes:
>> Reading back my own mail, I can see that I probably wasn't explicit
>> enough about the interface change. Sorry about that.
>>
>> I'm suggesting that there be higher-level interfaces to weak-list-like
>> data structures.
>>
>> - "Simple" weak lists have weak-list-car and weak-list-cdr.
>>
>> - The various types of weak alists have higher-level functions to
>> access them like:
>>
>> weak-list-add-association
>> weak-list-assq
>> weak-list-assoc
>> weak-list-map
>> weak-list-mapc
>>
>> ...
Hrvoje> Not to mention that things won't work with things like push, pushnew,
Hrvoje> mapcar*, and oodles of nice things that works with normal lists.
These kinds of things you don't really *want* to work with weak lists:
They're fundamentally different from ordinary lists. I'd even want to
remove WEAK-LIST-MAP. The ... was not meant to reflect that I'd want
more accessors. EMPTY-WEAK-LIST and WEAK-LIST->LIST would probably be
everything else that's required.
Why would you _not_ want these to behave in exactly the same way from lisp,
other than creation time and GC time? If they behave like a normal list,
experimenting with which is better for a specific application is incredibly
simple. There are no separate interfaces for weak hash tables (which _are_
used in 3rd party lisp code).
Switching the glyph or face caching in Emacs/W3 to use weak lists would be
very simple the way it stands now, otherwise I'd have to change many more
places in the code.
-Bill P.