On 1/10/19 2:38 PM, John Cowan wrote:
> * A "uniform vector" or "homogeneous vector" is one of the types of SRFI-4 or SRFI-160.
>
> * A "generic vector" or "heterogeneous vector" is the traditional Scheme vector:
> the result of make-vector or vector literals.
> * can be either a uniform vector or a generic vector.
>
>
> Words missing here?
A "generalized vector" can be either a uniform vector or a generic vector.
> A bounded range should also be a generalized vector. The expectation is that
> TYPE-length and TYPE-ref should be efficient and O(1).
>
> I don't agree that bounded ranges should be vectors: in particular, vectors (except
> literals) are mutable, ranges are not.
That's like saying "strings (except literals" are mutable".
It think Scheme should have immutable vectors. SRFI 122 has immutable arrays.
Regardless, I think it is very useful to allow ranges in many places where one
would allow read-only vectors. One example is pair array-index-ref (and the
similar array-index-share) in SRFI 164.
> I know some of you want to preserve the traditional Scheme model
> of disjoint procedures for disjoint data types. However, that model breaks
> once you have a dozen or more disjoint sequence types. Just looks at SRFI 160
> with its more than 500 new procedures. This model has failed. If we going to add 11
> new types, we can't add 50 disjoint procedures for each type.
?
> That's why SRFI 160 has multiple libraries. My assumption is that you are likely to
> want only a few types in any given program.
Separate libraries only slightly improves the situation. Just consider the verbosity
of the procedure index in a reference manual. Also consider that 50 procedures
just to deal *specifically* with signed 32-bit integer vectors is by itself excessive.
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/