Is anyone familiar with the murphy/protobuf module?  I'm running into two
    1) How do I use non-primitive types?
    2) How do I use 'repeated' fields?

I'm working with the Protocol Buffers standard, using the murphy/protobuf
module from PLaneT.  This works:

;;   In file defs.rkt
#lang racket/base
(require (planet murphy/protobuf:1/syntax))

  ((required primitive:string address 1)
   (required primitive:int32 id 2)))

(provide (all-defined-out))


;;   In file serialize.rkt
#lang racket

(require (planet murphy/protobuf))
(require "defs.rkt")

(define p (endpoint* #:address "" #:id 42))

(serialize p) ;; serialize, send to the current output port


;;  in file deserialize.rkt
#lang racket

(require (planet murphy/protobuf))
(require "defs.rkt")

(endpoint-address (deserialize (endpoint*)))  ;; read from current input


;;    At command line:
$ racket serialize.rkt | racket deserialize.rkt

What I'd like to be able to do is create and then use something like this:

    ((repeated endpoint the_points 1)))

Whenever I try this, however, I get strange error message that mean nothing
to me, such as:

       'match-lambda: no matching clause for #<field-info>'
and 'deserialize: missing required fields: (seteqv 1 2)'

I've tried digging through the source of the protobuf module, but it's
making my brain hurt.  Any advice would be gratefully received.


You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to