qitab / cl-protobufs

Common Lisp protocol buffer implementation.
MIT License
82 stars 17 forks source link

Handle groups in a simpler way, remove duplication #288

Closed copybara-service[bot] closed 3 years ago

copybara-service[bot] commented 3 years ago

Handle groups in a simpler way, remove duplication

Previously there was a special define-group macro that largely duplicated the define-message macro, with a few differences. Instead, we now generate a normal nested message (a call to define-message) AND a field by the same name. This is how the spec describes the semantics of groups. This allows the deletion of the define-group macro.

This is an API change since (define-group foo ...) used to generate a top- level message FOO whereas now the nested (define-message foo ...) generates the name OUTER-MESSAGE.FOO.

As a side benefit, the C++ code is actually simpler because (it appears) this is the way protoc was designed to handle groups.