by John Cowan
The portable SRFI-4 implementation in this directory is constructed
in two layers. It should work on any R6RS or R7RS system, or any
Scheme that provides even minimal bytevectors: it relies only on the primitives
make-bytevector, bytevector?,
bytevector-length,
bytevector-u8-ref, and bytevector-u8-set!.
The implementation also uses either SRFI 9, R6RS record types,
or R7RS record types.
However, it should not be used to replace a native SRFI 4
implementation, as it is very likely to be much less efficient.
The lexical syntax of SRFI 4 is not provided.
Note that on R6RS systems the library is named (srfi :4),
whereas on R7RS systems it is named (srfi 4).
The lower layer is a portable
implementation of the R6RS bytevector library. So that it can be
run and tested on R6RS systems, it is named (r6rs bytevectors)
rather than (rnrs bytevectors (6)).
It depends only on the five primitives.
(In Chicken 5 these are simulated with u8vectors from the native SRFI 4
implementation.)
However, if a native R6RS library is available, it is likely to be much more performant and should be used instead. In particular, the conversions between bytes and strings, and between bytes and inexact numbers, can be implemented much more efficiently in a low-level language such as C.
The following files are provided for this layer:
include.scm - R6RS library for file inclusion r6rs.bytevectors.scm - Chicken 5 library.r6rs/bytevectors.scm - Guile library.
Can be adapted to any R6RS system.r6rs/bytevectors.sld - Chibi library.
Can be adapted to any R7RS system.r6rs/bytevectors-impl.scm - Shared implementation
from snow-fort.org by Will Clinger, slightly modified for this SRFI.r6rs/chicken-ieee.scm - Chicken 5 implementation
of native IEEE procedures in mixed Scheme and C.r6rs/r7rs-shim.scm - R7RS shim.
Provides the non-primitive R7RS bytevector procedures.
These can be used by any R5RS system that provides
the primitives and bitwise operations.r6rs/shared-tests.scm - Shared tests (no dependencies).r6rs/chicken-tests.scm - Chicken 5 test script wrapper.r6rs/guile-tests.scm - Guile test script wrapper.r6rs/chibi-tests.scm - Chibi test script wrapper.r6rs/ypsilon-tests.scm - Ypsilon test script wrapper.r6rs/guile-native-tests.scm - Guile native test wrapper.r6rs/ypsilon-native-tests.scm - Ypsilon native test wrapper.The upper layer provides the procedures of SRFI 4.
It can be layered over either the (r6rs bytevectors) library
or a native (rnrs bytevectors (6) library.
The following files are provided for this layer:
srfi/4.sld - Chibi library. Should work in any R7RS system, srfi/%3a4.scm - Ypsilon library. Should work in any R6RS system.srfi/4/impl.scm - Implementation of SRFI 4 procedures
using a bytevector library.srfi/4/macros.scm - Macros used by the implementation.srfi/4/r6rec.scm - Record-type definitions for R6RS.srfi/4/r7rec.scm - Record-type definitions for R7RS.srfi/4/shared-tests.scm - Shared tests (no dependencies).srfi/4/chicken-native-tests.scm - Chicken 5 native test script wrapper.srfi/4/chibi-tests.scm - Chibi test script wrapper.srfi/4/ypsilon-tests.scm - Ypsilon test script wrapper.All tests must be run from the directory containing this README file.
The shell script all-tests will run all tests. It assumes that
the Chicken 5 compiler and interpreter are on the shell's search path
as csc and csi,
the Chibi interpreter as chibi-scheme,
the Guile 2.x interpreter as guile
and the Ypsilon interpreter as ypsilon.
All lines ending in OK represent successful tests and
are filtered out by default.
Simply comment out runs of any Schemes you don't have.