Hi!

Andy Wingo <wi...@pobox.com> skribis:

> What is a vector?
>
> Possible answers:
>
>   1. A vector is something that answers #t to vector?, which contains
>   some number of storage slots accessible in a mostly-O(1) way, the
>   number of slots is given by vector-length, and the slots can be
>   accessed with vector-ref and vector-set!.
>
>   2. A vector is a specific kind of object, implementing the interface
>   described above, and disjoint from all other kinds of objects.
>
>   3. A vector is a specific kind of object, as before, disjoint from all
>   other kinds of objects defined in the R5RS.
>
>   4. A vector is a specific kind of object, as before, disjoint from all
>   other kinds of objects defined in the R6RS.
>
> (1) defines vectors as an interface.
>
> (2) defines vectors as a specific data structure.
>
> (3) admits to a number of distinct types that may be vectors, of which
>     one kind is defined by the R5RS.
>
> (4) is like (3), but it precludes bytevectors from being vectors.

I would vote for (2).  Vectors are a specific data structure that has
always (?) been defined in the Scheme reports, so it ought to remain
disjoint IMO.

Guile’s arrays are closer to (1), but with a multi-dimensional
interface.

Ludo’.

Reply via email to