Is anyone familiar with the murphy/protobuf module?  I'm running into two
issues:
    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
<https://planet.racket-lang.org/display.ss?package=protobuf.plt&owner=murphy&changerep=2>
module from PLaneT.  This works:


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

(define-message-type
  endpoint
  ((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 "129.127.8.8" #: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
port


----------------

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



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

(define-message-type
    endpoint_list
    ((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.

Dave

-- 
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 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to