tracingplane-java icon indicating copy to clipboard operation
tracingplane-java copied to clipboard

Make all struct variables optional

Open JonathanMace opened this issue 8 years ago • 2 comments

All variables should be optional in a struct

JonathanMace avatar Feb 10 '17 19:02 JonathanMace

Also add 'one of' to structs

JonathanMace avatar Feb 10 '17 19:02 JonathanMace

To enable structs to have optional values, and still be lexicographically comparable, 'not present' is lexicographically less than 'any value'; the optional flag must therefore precede each variable as opposed to a single block of flags at the start of the struct.

This would be quite expensive as it entails an extra byte per field.

Ideally, we'd have really nice encoding that figures this out. But we don't. Do this at some point.

JonathanMace avatar Feb 10 '17 19:02 JonathanMace