[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] some questions on byte vectors + ports
On Wed, Jun 27, 2012 at 2:10 PM, Aubrey Jaffer <agj@x> wrote:
> | Date: Wed, 27 Jun 2012 10:04:21 -0700
> | From: Alex Shinn <alexshinn@x>
> | On Wed, Jun 27, 2012 at 9:52 AM, Aubrey Jaffer <agj@x> wrote:
> | > | From: Wolfgang De Meuter <wdmeuter@x>
> | > | Date: Wed, 27 Jun 2012 14:06:41 +0200
> | > |
> | > | ...
> | > | to me, byte vectors are pretty useless if you don't have a minimal
> | > | amount of comfort for encoding/decoding data types. And, given the
> | > | fact that you no longer support this comfort, is there sufficient
> | > | support to break down/ build up Scheme data types (integers,
> | > | float,…) into / from raw bytes ? I.e., can I convert an integer or
> | > | a float to a byte vector?
> | >
> | > SLIB provides R4RS/R5RS Scheme code to accomplish these conversions in
> | > a way which is unaffected by host byte-order. See:
> | > <http://people.csail.mit.edu/jaffer/slib/Byte_002fNumber-Conversions.html#Byte_002fNumber-Conversions>
> | Note this is not truly portable in R4/R5 - you do need read-u8
> | and write-u8 provided by R6/R7.
> The SLIB conversions between numbers and byte-vectors do not require
> read-u8 or write-u8.
Oh, I thought you were referring to the I/O operators.
In that case, it's still not portable R4/R5 because these
had no portable byte-vectors (without srfi-4 or one of
the many array srfi's).
Scheme-reports mailing list