srfi-164 (array) and generaized vectord

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

srfi-164 (array) and generaized vectord

Per Bothner
I've been working on SRFI 164 (Enhanced multi-dimensional Arrays)
This is more-or-less the Kawa design:
which is a superset of SRFI 25 (

I've been frustrated by the lack of support and feedback, and am tempted to withdraw
the proposal because of that.  So if you care about multi-dimensional arrays, and
like the basic Kawa approach, please provide feedback (and encouragement).

I could declare the specification "good enough", but it depends on two concepts that
are also new:

* Ranges are used for convenient and efficient selection of slices and rectangular sections.
Kawa has ranges ( but they use a special
syntax which is not suitable for standardization, and otherwise there is little prior art.
I'm not sure what to do about that.  The SRFI 164 draft includes a simple range API, but
it is not implemented (even in Kawa), though it should be easy to do so.

* SRFI-164 has a concept of a "generalized vector", which is a superset of traditional
vectors, uniform vectors, bitvectors, and ranges. Roughly: sequences that are random-access
indexable. Kawa has a "generalized sequence" concept,  which (for example) allows indexing
using function-call syntax. However, I think it is useful to generalize functions like
vector-ref to work with "generalized vectors" but not go as far as allowing arbitrary
sequences.  The attached patch adds a new type "gvector" for generalized vector, and
generalized vector-ref and some other function signatures to work with gvectors.

Feedback more than welcome.
        --Per Bothner
[hidden email]

gvector.patch (12K) Download Attachment