should there be conversion from/to homogeneous vectors? Duy Nguyen (24 Dec 2019 09:31 UTC)
Re: should there be conversion from/to homogeneous vectors? Duy Nguyen (25 Dec 2019 08:58 UTC)

Re: should there be conversion from/to homogeneous vectors? Duy Nguyen 25 Dec 2019 08:57 UTC

On Wed, Dec 25, 2019 at 12:56 AM John Cowan <xxxxxx@ccil.org> wrote:
> On Tue, Dec 24, 2019 at 4:32 AM Duy Nguyen <xxxxxx@gmail.com> wrote:
>
>> I see there are bitvector->vector/etc and vector->bitvector/etc but
>> there's no equivalent for homogenous vectors. Is it a good idea to add
>> them?
>
>
> With a few exceptions like SRFI 128 comparators, I try to avoid this sort of architectural dependency of one SRFI on another, such that you have to implement both or neither.  Implementation dependency is fine, since the implementation can always be replaced.  It's very easy to roll your own loop, to use ordinary vectors as an intermediate, to use `make-foreach-generator` and `generator-unfold` from SRFI 158, or to use the `accumulate-generated-values procedure` from the pre-SRFI at <https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/MoreGenerators.md>.

I think the main value is having the same api across scheme
implementations. Assuming r7rs as base, this could be just put in an
extra library (and optional, scheme implementer's choice). Though of
course we could just leave it out, it could be a separate srfi later
if somebody really wants it.
--
Duy