Ever since I first used protocol buffers, the construct [packed=true] 
appeared like a temporary hack to me.
 
Here my proposal:
Alternate syntax (with same constraints and semantics)
 
Example Old:
repeated uint32 my_element = 1 [packed=true];
 
Example New:
packed uint32 my_element = 1;
 
 
Advantages: 
 - Improved semantics. Since the encoding is entirely different for 
repeated and packed=true collections, this is not really an option (as in a 
minor tweak) - it is something different.
 - Easier to parse. For tools, the new syntax allows to treat all possible 
elements in a more consistent style (required, repeated, optional, packed). 
While at this level there is already a small semantic collision 
(required/optional address versioning, repeated addresses "collections"), 
the packed syntax would not make it worse.
 - Easier to read.
 - Easier to write.
 - Clear separation from "other options".
 
I propose to first add the new packed syntax as possible, later to 
deprecate the [packed=true] and eventually to remove [packed=true] and have 
the new syntax alone.
 
 
 

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to