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>.

While in packed modes, 8 items in the bitvector becomes one
in u8vector. The packed mode could be useful for manipulating
compression/video bitstreams. But maybe bitvector is not the right
place for this.

I think this does make sense, and I will add packng and unpacking conversions between bitvectors and bytevectors.  Note that SRFI 160 recommends that bytevectors and u8vectors be the same thing; however, in Guile they are disjoint.

Also it's not clear to me how the conversion from a vector to
bitvector happens. What if the vector contains values other than 0, 1,
#t and #f? Is that an error, or does vector->bitvector/etc consider
all non-zero as one/#t?

I think I'll leave it open. The implementation in progress assumes that whatever is not #f or 0 is a 1 bit.

On Tue, Dec 24, 2019 at 12:07 PM Arne Babenhauserheide <xxxxxx@web.de> wrote (in another thread):

I implemented a Hamming-code with Scheme last year, and I’m missing the
hardest part from this SRFI: How to read a file into a bitvector which
does not have bits that are a multiple of 8? How to write such a
bitvector to a file?

Is that out of scope or already provided by another SRFI?

I think a bit I/O SRFI is a good idea, but I think this SRFI is complicated enough.  Such a SRFI would need to use bytevectors as buffers, I think, and should probably be integrated into the generator/accumulator framework.



John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
Consider the matter of Analytic Philosophy.  Dennett and Bennett are well-known.
Dennett rarely or never cites Bennett, so Bennett rarely or never cites Dennett.
There is also one Dummett.  By their works shall ye know them.  However, just as
no trinities have fourth persons (Zeppo Marx notwithstanding), Bummett is hardly
known by his works.  Indeed, Bummett does not exist.  It is part of the function
of this and other e-mail messages, therefore, to do what they can to create him.