Re: vector->range issues Wolfgang Corcoran-Mathe 02 Sep 2020 14:45 UTC

On 2020-09-02 09:57 +0200, Marc Nieper-Wißkirchen wrote:
> > Rename it to
> >
> > ivector->range
> >
> > ?
>
> Better suggestion:
>
> (vector-range VECTOR)
>
> wraps VECTOR in a range.
>
> (vector->range VECTOR)
>
> copies the vector first.
>
> The naming vector-range is consistent with numeric-range and other
> range-constructors we may conceive in the future.

I agree that vector-range is essentially a constructor, while
vector->range is a conversion, so I like this idea.  (I also
considered the possibility of calling the non-copying form
vector->range!, but it's not quite a linear update procedure--future
use of the vector argument is valid, but must be read-only.)

Added to my repository.

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

"Fools ignore complexity.  Pragmatists suffer it.  Some can avoid it.
Geniuses remove it." --Alan J. Perlis