Am Di., 1. Sept. 2020 um 21:21 Uhr schrieb Wolfgang Corcoran-Mathe
<xxxxxx@sigwinch.xyz>:
>
> I'm thinking that the restriction on vector->range ("it is an error to
> mutate <vector>") is actually a bad abstraction leak. Not being able to
> mutate a vector after passing it to this procedure is unfortunate, as
> mutation is a fundamental operation on vectors. I wonder if this
> means that the only real use of vector->range will be as a sort of
> shorthand for constructing a discrete range, by passing literal
> vectors. If so, perhaps it would be better to *remove* the
> restriction on vector->range (i.e. copy the vector argument), and
> provide a discrete range constructor (conventionally, this would be
> called `range'):
I think there are many more uses. Like in
(vector->range (vector-unfold <some-complicated-proc> n))
> (range* 1 2 3 5 7) == (vector->range #(1 2 3 5 7))
This is unfortunately as slow as copying the vector.