As part of the pull request, I converted example arrays to show their
full layout in gory detail.  Part of this led to some clarifications
to questions that people have apparently been asking about how null
flags interact between parent/child arrays and some cleanup in
language.  I don't think these changes should be controversial but I'm
summarizing them here in case they are.

* Offset arrays for lists and dense unions are now called offset
buffers, implying we don't track null values separately for them and
their sizes can be computed based on the array they are contained in.
 Similarly the types array for unions is now called a types buffer for
the same reason.

* For structs and unions, a null struct or null union (e.g. the slot
on the parent array is marked null) does not imply that the
corresponding slot on the children arrays is empty.  Similarly the
type for a slot on a sparse union, doesn't imply that the slots on the
children arrays that aren't of the type selected are null.  This
facilitates construction of sparse unions and structs without
requiring copying/mutating the underlying arrays.

One open question that this leaves is for unions, is if a slot is
marked as null, should there be any contract imposed on the
corresponding offset and type value (e.g. should we make it -1.  I
would vote no, but can see reasons for going both ways).

Thanks,
Micah

P.S. This pull request also includes a summary of endianness but not
the other issues discussed on the most recent document layout thread
(I'm giving those a little bit more time for others to comment and
will open up a separate JIRA/Pull request to implement them).

Reply via email to