Clarification

This commit is contained in:
Tony Garnock-Jones 2022-06-13 15:50:15 +02:00
parent 666f8e1643
commit 894000a54f
2 changed files with 8 additions and 3 deletions

View File

@ -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]

View File

@ -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