[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: propose deprecation of generalized-vector-*
From: |
Ludovic Courtès |
Subject: |
Re: propose deprecation of generalized-vector-* |
Date: |
Wed, 23 Jan 2013 15:55:57 +0100 |
User-agent: |
Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) |
Hi!
Andy Wingo <address@hidden> 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’.