[r6rs-discuss] vectors of unsigned octets

From: r6rsguy at free-comp-shop.com <r6rsguy>
Date: Thu, 21 Jun 2007 21:27:08 -0400

> r6rsguy at free-comp-shop.com writes:
>
> I am concerned that the syntax #vu8(...) for a bytevector
> is irregular, hard to remember, and ugly.
>
> The name of these objects has been changed to "bytevector",
> why not write the external representation as #bytevector(...)?

Nobody seemed to like that suggestion. I don't see how
a Scheme programmer could like #vu8, it seems to me that
it is the kind of mnemonic that an assembly language
programmer would invent.

OK, I have written assembly language. Since we have this
excellent three keystroke name, why not use it consistently,
i.e. for the procedure names too?

Vectors of unsigned octets are written #:vu8(<u8>*), and
are manipulated by the procedures:
(vu8? obj)
(make-vu8 k fill)
(vu8-length vu8)
(vu8=? vu8-1 vu8-2)
(vu8-u8-ref vu8 k)
(vu8-s8-ref vu8 k)
(vu8-uint-ref vu8 k size endianness)
(vu8-sint-ref vu8 k size endianness)
... etc ...

The explanatory text should be changed to use the term
"vector of unsigned octets" instead of "bytevector"
so that the official name matches the mnemonic.

What is #vs8(-1 0 1)?

After (or before) carefully explaining that octets are unsigned
and bytes are signed, R5.94 requires bytevector literals to be
made with unsigned integers (page 16, 3.3.1). That can't be right.

    -- Keith
Received on Thu Jun 21 2007 - 21:27:08 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC