diff --git a/cheatsheet.md b/cheatsheet.md index 2df7324..e2fef67 100644 --- a/cheatsheet.md +++ b/cheatsheet.md @@ -8,7 +8,10 @@ June 2022. Version 0.7.0. ## Machine-Oriented Binary Syntax -For a value `v`, we write `«v»` for the binary encoding of `v`. +For a value `v`, we write `«v»` for the binary encoding of `v`. The +length of an encoding is always available from context: either from +a containing encoded value, or from the overall container of the data, +which could be a file, an HTTP message, a UDP packet, etc. «#f» = [0xA0] «#t» = [0xA1] diff --git a/preserves-binary.md b/preserves-binary.md index cc94369..a2164e1 100644 --- a/preserves-binary.md +++ b/preserves-binary.md @@ -29,8 +29,10 @@ Each `Repr` starts with a tag byte, describing the kind of information represented. However, inspired by [argdata][], a `Repr` does *not* describe its own -length. Instead, the surrounding context must supply the expected length -of the `Repr`. +length. Instead, the expected length of the `Repr` is always available +from the surrounding context: either from a containing encoded value, or +from the overall container of the data, which could be a file, an HTTP +message, a UDP packet, etc. As a consequence, `Repr`s for `Compound` values store the lengths of their contained values. Each contained `Value` is represented as a