[r6rs-discuss] use of "bytes"

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Mon Nov 20 15:12:23 EST 2006


Per Bothner <per at bothner.com> writes:

> But another anbiguity is whether bytes are signed or unsigned.  As a
> measure of storage size (the most common one) it doesn't matter, but as
> a data type it does. Notice that "byte" in both Java and C\# is signed.
> (C# also has "unsigned byte".)

You are right about Java, but in C# byte is unsigned, sbyte is signed.

IMHO unsigned bytes are more practical and should be enough for
everybody (it's trivial to convert them when needed), although
if a function accepts a byte as an argument, there is no harm
in accepting -128..-1 too.

As for "byte" vs. "octet", I feel that almost everyone calls them
bytes in practice, except things like Internet standards, and that
today each byte has 8 bits.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/



More information about the r6rs-discuss mailing list