[plt-scheme] bytes vs u8vector

From: Eli Barzilay (eli at barzilay.org)
Date: Sat Jan 28 11:04:25 EST 2006

On Jan 28, Lauri Alanko wrote:
> How come SRFI-4/66 u8vectors are a distinct data type from byte
> strings?  This means that to make an interface compatible with other
> implementations that support the SRFIs, one has to make it less
> convenient to use in mzscheme, since byte strings are much better
> integrated with the system than u8vectors. Is there some FFI issue?

A few issues:

1. The same implementation is used for all srfi-4 vectors.  You're
   talking about an exception for one case.

2. Making that one case use byte strings is not possible, since a byte
   string always has a terminating \nul character.

3. So the only option seems to be to make the u8 procedures accept
   either a cvector object or a byte string, but why not do the same
   for other types too?  In any case, the result it going to be
   messier (and a little slower).

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.