Commits

Yasir M. Arsanukaev  committed 18b80da

Implement string encoding.

  • Participants
  • Parent commits c5f7264

Comments (0)

Files changed (2)

+bert = BERT.encode(t[:foo,42,666,t[12,[],t[255,:bar],111222333444555666]])
+
+bert.each_byte{|c| print c, ' '}
+
+131 104 4 100 0 3 102 111 111 97 42 98 0 0 2 154 104 4 97 12 106 104 2 97 255 100 0 3 98 97 114 110 8 0 146 131 13 124 31 36 139 1

File README.markdown

+scheme-bert
+===========
+
+scheme-bert is a BERT (Binary ERlang Term) serialization library for Scheme. BERT is based on Erlang's [External Term Format](http://www.erlang.org/doc/apps/erts/erl_ext_dist.html).
+
+See the BERT specification at [bert-rpc.org](http://bert-rpc.org).
+
+Instances of the following Ruby classes will be automatically converted to the
+proper simple BERT type:
+
+* integer? (fixnum and bignum)
+* symbol?
+* list?
+* string?
+* vector?
+
+Instances of the following Ruby classes will be automatically converted to the
+proper complex BERT type:
+
+* 'nil
+* #t
+* #f
+* hashtable?
+
+TODO
+----
+Implement encoding of these objects:
+
+* flonum?
+* time?
+* pregexp?
+
+
+Installation
+------------
+
+    Installation for Racket:
+
+    $ plt-r6rs --install erl-ext-types.ss
+
+    Then just (import (encode))
+
+
+Usage
+-----
+
+    (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
+---------
+
+Copyright (c) 2010 Yasir M. Arsanukaev. See LICENSE for details.