[r6rs-discuss] Bytevectors

From: Ludovic Courtès <ludovic.courtes>
Date: Tue, 19 Jun 2007 13:15:00 +0200

Hi,

Michael Sperber <sperber at informatik.uni-tuebingen.de> writes:

> r6rsguy at free-comp-shop.com writes:

>> I suggest that the following name changes would improve euphony:
>> bytevector-u8-ref to octetvector-ref
>> bytevector-s8-ref to bytevector-ref
>> bytevector-u8-set! to octetvector-set!
>> bytevector-s8-set! to bytevector-set!
>> bytevector->u8-list to octetvector->list
>> u8-list->bytevector to list->bytevector
>
> This would suggest that "octetvectors" and "bytevectors" are different
> things, which they are not.
>
>> new procedure:
>> (bytevector->list <bytevector>) similar to octetvector->list,
>> but returns a list of integers in the range {-128..127}
>> There seems to be no procedure bytevector->s8-list, which
>> would be the natural name of this procedure in the R5.94
>> system.
>
> Right, but it is easily done using `bytevector->sint-list'. We
> considered adding more variants, but decided against it, as it would
> introduce bloat without introducing much value.

Agreed. The bytevector API looks both consistent and convenient to me.

Having operations specific to 16-bit, 32-bit and 64-bit integers allows
implementors to easily provide specialized (i.e., optimized) accessors,
which is good; it also allows programmers to make their intent clearer,
I think.

The read syntax is also acceptable IMO, especially since it doesn't
conflict with syntaxes specified by SRFIs such as SRFI-4.

Thanks,
Ludovic.
Received on Tue Jun 19 2007 - 07:15:00 UTC

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