[qitab-devel] Nested extensions in cl-protobufs

Thomas Munro munro at ip9.org
Sat Sep 21 00:10:20 UTC 2013


Hi!

I am starting out with cl-protobufs.  I would like to interact with a
service that is doing the equivalent of the following line of Python, which
allows polymorphic treatement of animals, creating a cat and serializing it
for transmission to a recipient expecting an Animal (the base message).

animal = Animal()
animal.type = Animal.Cat
cat = animal.Extensions[Cat.animal]
# now work with cat...
# now serialize animal ...

That example is from the tutorial at
http://www.indelible.org/ink/protobuf-polymorphism/ which shows the .proto
file containing Animal, Cat and Dog messages.

How would this code look in cl-protobufs? I'd be most grateful for any
clues.  I couldn't see anything like like this in the examples (but I admit
I'm totally new to the protobufs concepts, and rusty at Lisp, so might have
missed it...).

Thanks!

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/qitab-devel/attachments/20130921/0b29c146/attachment.html>


More information about the qitab-devel mailing list