Minor clarification of range-split-at Wolfgang Corcoran-Mathe (27 Aug 2020 04:28 UTC)
Re: Minor clarification of range-split-at Marc Nieper-Wißkirchen (27 Aug 2020 08:01 UTC)
Re: Minor clarification of range-split-at John Cowan (27 Aug 2020 16:27 UTC)

Minor clarification of range-split-at Wolfgang Corcoran-Mathe 27 Aug 2020 04:27 UTC

I've noticed a slight obscurity in the wording of range-split-at.  The
spec reads "The second value contains all elements of <range> from the
<index>th element inclusive to the last element."  Does this mean that
<index> must be a valid index of the range, rather than an exclusive
bound?  e.g. I'm unsure whether the following is valid:

    (range-split-at r (range-length r))

(range-length r) is not a valid index of r, so it's impossible to
construct a range beginning with the (range-length r)th element of r.
Obviously, though, we'd expect this to return r and and empty range.
I think this should be clarified, and that we should have:

    (range-split-at r i)

      ==

    (values (range-take r i) (range-drop r i)),

for 0 <= i <= (range-length r).

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

"Scientists must be optimists at heart, in order to block out the
incessant chorus of those who say 'It cannot be done.'"
--Academician Prokhor Zakharov