deque to Gauche for the next release.
(My current implementation is based on Chris Okasaki's book:
If you need another reference implementation, I'd be happy to make it portable
and adapt to this srfi's api.)
Here's a general comment:
I feel it's a bit overwhelming to have the whole set of sequence-like APIs.
The fundamental operations of deque are basically emtpy?,
front, back, add-front, add-back, remove-front and remove-back.
I just expect them, plus some constructors and converters, for
immutable deque.
I can understand the motivation of the rich API; although they can
be implemented trivially with ideque->list and list operation,
having them directly in ideque can save construction of intermediate
data structures. OTOH, if we keep on having this set across
sequence-like data types, I'd like to see them consistent. Each
data type exposing slightly different set of APIs will be very
confusing.
In ideque case, compared to srfi-1, I see the following difference:
Different signature: ideque-find takes failure thunk, while find
doesn't. I think taking failure thunk is a sensible choice, but
we may want different name for the API. (Yeah, we already have
set-find and bag-find, I know...)
Missing: Obviously the "linear update" version doesn't make sense
in immutable data types, but there are other APIs that are in
srfi-1 but not in ideque. Each of which I can imagine the reason;
e.g. make-ideque makes little sense in practice. But then,
I don't see ideque-take is so much useful that it is worth to
be in. (I'd imagine the use case where I want to get first
or last N items of ideque, but then I want it in list of N items
rather than another ideque.)
At this moment, I'd rather see a small set of opreations: Fundamental
operations, constructors and converters, and maybe a basic
iterator (fold).