|
Project Information
Featured
Downloads
Links
|
Protocol Buffers for R6RS SchemeWhat is it?This project provides a pure Scheme implementation of Protocol Buffers, including parsing and code generation. Visit the protobuf project page for information about the Protocol Buffers description language and the Protocol Buffers wire protocol. Latest Updateshttp://r6rs-protobuf.googlecode.com/svn/trunk/CHANGES.txt DocumentationDiscussionQuick ExampleYou write a .proto file like this package protobuf.person;
message Person {
required int32 id = 1;
required string name = 2;
optional string email = 3;
}and compile it like this (import (protobuf compile)) (define proto (protoc:read-proto (open-input-file "Person.proto"))) (protoc:generate-libraries proto) to produce an R6RS library form like this (library (protobuf person)
(export make-Person-builder
Person-builder?
Person-builder-build
Person-builder-id
set-Person-builder-id!
has-Person-builder-id?
clear-Person-builder-id!
Person-builder-name
set-Person-builder-name!
has-Person-builder-name?
clear-Person-builder-name!
Person-builder-email
set-Person-builder-email!
has-Person-builder-email?
clear-Person-builder-email!
Person-builder-extension
set-Person-builder-extension!
has-Person-builder-extension?
clear-Person-builder-extension!
Person?
Person-id
Person-name
Person-email
has-Person-email?
has-Person-extension?
Person-extension
Person-read
Person-write)
(import (rnrs base)
(rnrs enums)
(rnrs records syntactic)
(protobuf private))
...
)
|