Weaken disjointness of range type? Marc Nieper-Wißkirchen (01 Sep 2020 11:25 UTC)
Re: Weaken disjointness of range type? John Cowan (01 Sep 2020 18:19 UTC)
Re: Weaken disjointness of range type? Marc Nieper-Wißkirchen (01 Sep 2020 19:45 UTC)
Re: Weaken disjointness of range type? Wolfgang Corcoran-Mathe (04 Sep 2020 23:15 UTC)
Re: Weaken disjointness of range type? John Cowan (05 Sep 2020 03:03 UTC)
Re: Weaken disjointness of range type? Marc Nieper-Wißkirchen (05 Sep 2020 10:15 UTC)
Re: Weaken disjointness of range type? Wolfgang Corcoran-Mathe (05 Sep 2020 19:27 UTC)
Re: Weaken disjointness of range type? Marc Nieper-Wißkirchen (06 Sep 2020 07:25 UTC)
Re: Weaken disjointness of range type? John Cowan (05 Sep 2020 23:35 UTC)
Re: Weaken disjointness of range type? Marc Nieper-Wißkirchen (06 Sep 2020 07:36 UTC)
Re: Weaken disjointness of range type? John Cowan (07 Sep 2020 01:09 UTC)
Re: Weaken disjointness of range type? Marc Nieper-Wißkirchen (07 Sep 2020 06:18 UTC)
Re: Weaken disjointness of range type? John Cowan (08 Sep 2020 15:40 UTC)
Re: Weaken disjointness of range type? Marc Nieper-Wißkirchen (08 Sep 2020 15:58 UTC)
Re: Weaken disjointness of range type? Marc Nieper-Wißkirchen (05 Sep 2020 09:49 UTC)

Weaken disjointness of range type? Marc Nieper-Wißkirchen 01 Sep 2020 11:25 UTC

I have already suggested this in some other post on this list, but it
hasn't been discussed yet.

The way we all seem to envision ranges (as compactly represented
vector-like data), it can be helpful to weaken the disjointness of the
range type when it comes to the built-in vector type.

My suggestion is to allow (not enforce) for an implementation not to
distinguish between a range and a vector.

For such an implementation, vector->range and range->vector would be
no-ops. Every operation on ranges works easily well on vectors and
vector operations can be applied mutatis mutandis on ranges. (*)

Thus, I propose to change "Ranges belong to a disjoint type." to
"Ranges belong to a disjoint type, except for, possibly, vectors. In
an implementation where ranges are indistinguishable from vectors
through the type predicates, procedures accepting vectors must also
accept ranges and vice versa."

By the way, it fits the idea that SRFI 196 is the vector-answer to
SRFI 116 (immutable pairs). Immutable vectors (conceptionally) are
nothing but ranges.

Marc

--

(*) I know that ranges can only be viewed as read-only vectors, but so
are vector literals. Conceptually, the vector API therefore already
knows about immutable vectors.