- Change the name of the Lisp
protoc
plugin fromprotoc-gen-lisp
toprotoc-gen-cl-pb
to prevent conflict with Robert Browns protocol buffer implementation. See: #276.
-
Improve the API for printing and parsing JSON format.
- Have
pretty-print-p
be a parameter toprint-json
instead of indent. - Turn
parse-json
from a method into a function. - Remove
spliced-p
as a parameter toprint-json
andparse-json
.
- Have
-
Add format directives for both text-format and JSON printing of protocol buffer messages.
-
Change the
pretty-print
keyword parameter topretty-print-p
inprint-text-format
for consistency. -
A bug in
proto-equal
was fixed. Two protos were sometimes considered equal even if they had a repeated field with different values. -
map-descriptor
accessor functions have been renamed to match most other descriptor accessors. The old names may continue to be used, but will be removed in the next major release. The changes are:map-key-type
is nowproto-key-type
map-value-type
is nowproto-value-type
map-value-kind
is nowproto-value-kind
(:scalar
,:message
, or:enum
)
-
(defmethod find-field-descriptor ((desc message-descriptor) (name symbol))
has been changed such that thename
parameter no longer expects the internalized symbol (i.e., with a leading%
). If the field name is"foo_bar"
in the.proto
file thenname
should be the symbolfoo-bar
in the generated code's package. -
Remove the third returned value,
t
, fromfind-option
function when an option is found. -
*rpc-call-function*
is now exported fromcl-protobufs
rather than fromcl-protobufs.implementation
. (This is more relevant now that Common Lisp support for gRPC has been released.) -
Support
field: < message-value >
in textproto parsing.
This release is largely for an overhaul of the public API (hence a major version change) and for internal code quality improvements.
-
The
protobufs
package nickname has been removed. Use the full package name,cl-protobufs
, or use the:local-nicknames
option tocl:defpackage
which is widely available. -
The reflection APIs have been renamed to more clearly distinguish them from non-reflection APIs by adding the word "descriptor".
find-message
,find-enum
etc. are now calledfind-message-descriptor
etc. -
The descriptor types are now exported from
cl-protobufs
:message-descriptor
,service-descriptor
,enum-descriptor
, etc. -
push
,length
, andnth
functions have been added for repeated fields. Both generic and generated code versions are available. See README.md for details. -
base-message
was renamed tomessage
. This is the base type of any generated message struct. -
The enum accessors have been renamed for clarity, to prevent confusion about whether the "values" of an enum were keywords or numbers:
numeral->enum
is nowenum-int-to-keyword
enum->numeral
is nowenum-keyword-to-int
enum-values
is nowenum-keywords
- And similar renamings for the generated code versions. See README.md for details.
-
The serialization APIs have been made less redundant and more consistent:
- These definitions have been removed:
serialize-object
deserialize-object
serialize-object-to-file
(usewith-open-file
instead)deserialize-object-from-file
(usewith-open-file
instead)
serialize-object-to-bytes
is now calledserialize-to-bytes
.serialize-object-to-stream
is now calledserialize-to-stream
and the argument order matches the order fordeserialize-from-stream
.deserialize-object-from-bytes
is now calleddeserialize-from-bytes
.
- These definitions have been removed:
-
These definitions previously exported from
cl-protobufs
have been removed:map-class
map-key-class
(usemap-key-type
instead)map-value-class
(usemap-value-type
instead)merge-from-array
merge-from-message
undefined-field-type
undefined-input-type
undefined-output-type
undefined-stream-type
undefined-type
unknown-enum-error
error-type-name
error-field
error-method
-
The descriptor defining macros,
define-enum
,define-message
, etc. have been moved to the implementation package. These macros are only intended to be called by the generated code. -
The condition hierarchy has been simplified. A new type,
protobuf-error
is exported fromcl-protobufs
, along with two subtypes:unknown-type
andunknown-field-type
. The latter are signaled during serialization/deserialization, parsing, and printing when a non-protobuf type is encountered. For example if you accidentally store a non-protobuf type in a repeated field andcl-protobufs
can't figure out how to serialize it. -
Type declarations have been added to field accessor functions to improve speed.
-
If no
package
is specified in a.proto
file, protoc_gen_lisp now sets it tocl-protobufs.filename-without-extension
instead ofcl-protobufs-user
. -
Support for extensions has been added to the generated serialization code.
-
Internal support for groups has been redone such that a group field
G
is exactly equivalent to defining a nested message namedG
and a field namedg
of typeG
. This affects the API by changing the field accessor names from justg
toG.g
. See the section on Groups.
This version has many significant changes over the version that was originally
open-sourced. It reflects a change in direction from Lisp-centric to being more
like the implementations for other languages and is feature complete, including
proto3
. A high level list of changes follows.
-
It is no longer supported to write protocol buffer message definitions in Lisp. Generate the Lisp code with the
protoc
plugin instead. One of the primary benefits of protocol buffers is that it provides language-independent way to interoperate with other processes, and not using.proto
files as the message schema prevents that. -
For better performance, protocol buffer messages are now represented as structs instead of CLOS classes and the generated field accessors do not use generic dispatch. (It is still possible to use the generic field accessor functions, if performance isn't a primary concern.)
-
proto3
features were added:map
,oneof
-
Support for JSON printing and parsing.
-
Support for most of the protocol buffers well-known types.
-
ABCL and CCL are now fully supported and tested via GitHub CI. (SBCL has long been supported.)