[armedbear-devel] tentative patch: extensible sequences (following the same protocol as SBCL)

Alessio Stalla alessiostalla at gmail.com
Mon Mar 1 23:31:12 UTC 2010

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",
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
- 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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: extensible-sequences.patch.zip
Type: application/zip
Size: 14870 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/armedbear-devel/attachments/20100302/437670aa/attachment.zip>

More information about the armedbear-devel mailing list