Source

scheme-bert / README.markdown

Full commit

scheme-bert

scheme-bert is a BERT (Binary ERlang Term) serialization library for Scheme implementations compliant to R^6RS. BERT is based on Erlang's External Term Format.

See the BERT specification at bert-rpc.org.

Instances of the following Scheme types will be automatically converted to the proper simple BERT type:

  • flonum?
  • integer? (fixnum and bignum)
  • symbol?
  • list?
  • string?
  • vector?

Instances of the following Scheme types will be automatically converted to the proper complex BERT type:

  • 'nil
  • #t
  • #f
  • hashtable?
  • time?

Installation

Installation for Racket:

$ plt-r6rs --install ./src/scheme-bert.ss

(see http://docs.racket-lang.org/r6rs/Installing_Libraries.html for more info)

Usage

Issue (import (scheme-bert)) in your REPL or put this in head of your source file. You will also probably want to import some other libraries such as bytevectors.

(encode (vector 'foo 42 666 (vector 12 '() (vector 255 'bar) 111222333444555666)))
=>
#"\203h\4d\0\3fooa*b\0\0\2\232h\4a\fjh\2a\377d\0\3barn\b\0\222\203\r|\37$\213\1"

Copyright (c) 2010 Yasir M. Arsanukaev. See LICENSE for details.