(type egg)
(signature "msgpack egg")
(timestamp 1612269487)
(sxml ((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/msgpack" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.")) (section 2 "msgpack" (section 3 "Author" (p "Hugo Arregui")) (section 3 "Requirements" (ul (li (link "http://wiki.call-cc.org/egg/byte-blob" "byte-blob")) (li (link "http://wiki.call-cc.org/egg/numbers" "numbers")) (li (link "http://wiki.call-cc.org/egg/blob-utils" "blob-utils")) (li (link "http://wiki.call-cc.org/egg/bind" "bind")))) (section 3 "Description" (p "A " (link "http://msgpack.org/" "MessagePack") " implementation for scheme.")) (section 3 "API" (section 4 "Pack" (def (sig (procedure "(pack PORT VALUE)" (id pack))) (p "This procedure will call primitive type packers, with the following rules:") (ul (li "if the VALUE has a packer, apply it.") (li "if the VALUE is a string, it will be packed as str.") (li "if the VALUE is a blob, it will be packed as bin.") (li "if the VALUE is a char, it will be packed as a uint.") (li "if the VALUE is a list, it will be packed as an array.") (li "if the VALUE is a extension (see below), it will be packed as an ext"))) (def (sig (procedure "(pack-uint PORT VALUE)" (id pack-uint)))) (def (sig (procedure "(pack-sint PORT VALUE)" (id pack-sint)))) (def (sig (procedure "(pack-float PORT VALUE)" (id pack-float)))) (def (sig (procedure "(pack-double PORT VALUE)" (id pack-double)))) (def (sig (procedure "(pack-bin PORT BYTE-BLOB)" (id pack-bin)))) (def (sig (procedure "(pack-str PORT STRING)" (id pack-str)))) (def (sig (procedure "(pack-array PORT VECTOR)" (id pack-array)))) (def (sig (procedure "(pack-map PORT HASH-TABLE)" (id pack-map)))) (def (sig (procedure "(pack-ext PORT EXT)" (id pack-ext))))) (section 4 "Unpack" (def (sig (procedure "(unpack PORT [MAPPER identity])" (id unpack)))))) (section 3 "Extension" (section 4 "Definition:" (def (sig (record "(extension type data)" (id extension))) (ul (li "type: integer from 0 to 127") (li "data: a byte-blob")))) (section 4 "Example:" (highlight scheme "(make-extension 1 (string->byte-blob \"hi\"))"))) (section 3 "License" (p "BSD")))))
