type disjointness Alex Shinn (02 Jan 2019 06:47 UTC)
Re: type disjointness John Cowan (02 Jan 2019 13:27 UTC)
Re: type disjointness Per Bothner (06 Jan 2019 07:10 UTC)
Re: type disjointness John Cowan (07 Jan 2019 14:21 UTC)
Re: type disjointness Arthur A. Gleckler (07 Jan 2019 16:13 UTC)
Re: type disjointness John Cowan (07 Jan 2019 20:59 UTC)
Re: type disjointness Per Bothner (10 Jan 2019 20:19 UTC)
Re: type disjointness John Cowan (10 Jan 2019 22:38 UTC)
Re: type disjointness Per Bothner (11 Jan 2019 01:04 UTC)
Re: type disjointness John Cowan (11 Jan 2019 01:50 UTC)
Re: type disjointness Per Bothner (11 Jan 2019 19:41 UTC)

Re: type disjointness Per Bothner 11 Jan 2019 01:03 UTC

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/