'subrange' procedure and subrange comparators Wolfgang Corcoran-Mathe (21 Jul 2020 02:15 UTC)
Re: 'subrange' procedure and subrange comparators John Cowan (21 Jul 2020 18:51 UTC)
Re: 'subrange' procedure and subrange comparators Arthur A. Gleckler (22 Jul 2020 00:07 UTC)
Re: 'subrange' procedure and subrange comparators John Cowan (22 Jul 2020 03:02 UTC)
Re: 'subrange' procedure and subrange comparators Arthur A. Gleckler (22 Jul 2020 03:57 UTC)
Re: 'subrange' procedure and subrange comparators John Cowan (22 Jul 2020 15:27 UTC)
Re: 'subrange' procedure and subrange comparators Arthur A. Gleckler (22 Jul 2020 19:02 UTC)

'subrange' procedure and subrange comparators Wolfgang Corcoran-Mathe 21 Jul 2020 02:15 UTC

As discussed briefly on IRC, I that think a subrange procedure would
be useful:

(subrange range start end)

Returns a range with the same element comparator as *range* which
contains the elements of *range* from index *start*, inclusive,
through index *end*, exclusive.  This procedure must run in O(1)
time.

I think it might also be wise to state in the SRFI document that the
following existing procedures also preserve the element comparator
of their range arguments:

* range-take(-right)
* range-drop(-right)
* range-reverse
* range-take-while(-right)
* range-drop-while(-right)

It seems obvious, but all hell would break loose if ranges and their
subranges were to have different element comparators.

Otherwise, everything looks good to me.

--
Wolfgang Corcoran-Mathe  <xxxxxx@sigwinch.xyz>

"The composer makes plans, music laughs." --Morton Feldman