SRFI 178: Bitvector library Arthur A. Gleckler (22 Dec 2019 19:57 UTC)
Re: SRFI 178: Bitvector library Arne Babenhauserheide (24 Dec 2019 17:07 UTC)
Hamming code Lassi Kortela (27 Dec 2019 19:38 UTC)
Re: Hamming code Arne Babenhauserheide (29 Dec 2019 02:08 UTC)
Re: Hamming code John Cowan (29 Dec 2019 05:32 UTC)

Re: Hamming code Arne Babenhauserheide 28 Dec 2019 22:20 UTC
Lassi Kortela <xxxxxx@lassi.io> writes:

>> 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?
>
> I.e. an option to drop all the parity bits on read/write?

Something simpler: How to read a file and write it hamming-encoded?

How to read from a port and write a hamming-encoded bitstream to another
port?

How to decode (and fix) hamming-encoded data from a port and write it to
another one?

This is for teaching people networking code.

Something like:

 (match (bitvector->list (bitvector-get! readport 11))
        ((p1 p2 d3 p4 d5 d6 d7 p8 d9 d10 d11)
         (bitvector-put! writeport
             (decode-hamming-11/7 p1 p2 d3 p4 d5 d6 d7 p8 d9 d10 d11))))

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken