Greetings everyone,
I'm happy to announce that I have a preliminary version of user-extensible sequences working on ABCL, following the protocol proposed and implemented by Christophe Rhodes on SBCL ("User-extensible sequences in Common Lisp", http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.65.1604&rep=rep...). This includes:
- the possibility for the user to write subclasses of CL:SEQUENCE - all functions operating on sequences have a corresponding generic function in the SEQUENCE package that is called on user-defined sequence types, and for which the user can write methods to implement his/her custom sequences - make-sequence works with user-defined sequences (using sequence:make-sequence-like as in SBCL) - mop::class-prototype has been added (as a tiny wrapper around mop::allocate-instance) - iterating over user-defined sequences integrated with LOOP (untested, but should work as our loop implementation is derived from CMUCL like SBCL's) - MAP and MAP-INTO should work unchanged
limitations/things missing wrt. SBCL (that I know of):
- no integration with DOSEQUENCE - to use extensible sequences you must explicitly (require :extensible-sequences) in advance - much less attention to precise sequence type information (but probably my patch doesn't improve nor worsen the situation before it)
the patch doesn't seem to break any new ANSI tests; however I've tested the extensible sequences proper very lightly, and I don't consider the patch ready for trunk yet. My long-term goal is to use the new extensible sequences support to make Java collections be Lisp sequences. That should include Clojure collections as well, since afaik they implement the Collection API.
If anyone has comments or critiques, or wants to help, you're welcome.
Cheers, Alessio