bytestrings

Bytestrings
Login

This is an implementation of a pre-SRFI specification by John Cowan which provides bytestrings for Scheme. It should be portable to any R7RS-small implementation with SRFI 1/(scheme list), SRFI 151/(scheme bitwise), and one of Scheme's string libraries (one of SRFIs 152, 130, or 13). In addition, SRFI 145 and (scheme bytevector) are optional dependencies.

Extensions

This implementation provides the following additional procedures for inspecting error objects raised by some bytestring procedures; namely, those satisfying bytestring-error?:

(bytestring-error-message error-object)

Returns the message (string) encapsulated by error-object.

(bytestring-error-irritants error-object)

Returns a list of the irritants encapsulated by error-object.

Implementation Notes

(hex-string->bytevector s) returns false if s cannot be interepreted as a base 16 number, in the sense of string->number.

Acknowledgements

The implementation of hex-string and base64 encoding and decoding is from Alex Shinn's chibi-scheme. This code is found in the hex.scm and base64.scm files, along with the chibi-scheme license.

The implementation of several functions is heavily inspired by Olin Shivers's SRFI 13.

Of course, any misuse of Alex's or Olin's code or ideas is purely my own.

Author

Wolfgang Corcoran-Mathe

Email: wcm at sigwinch dot xyzzy minus the zy

License

This is free software released under the MIT/X license. See LICENSE for details.