From cc97b6150ce14bf3146428287461492744b735c8 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sat, 11 Jun 2022 11:24:11 +0200 Subject: [PATCH] Another note on lengths and reading --- cheatsheet.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cheatsheet.md b/cheatsheet.md index 4cdc3b5..e12b301 100644 --- a/cheatsheet.md +++ b/cheatsheet.md @@ -41,6 +41,11 @@ binary representation of `x`, taking exactly as many whole bytes as needed to unambiguously identify the value and its sign. `intbytes(0)` is the empty byte sequence. +When reading, the length of the input is supplied externally. This means +that, when reading a length/value pair in a `seq()`, each length should +be passed down to the decoder for the corresponding value, so that the +decoder knows when to stop. + **Annotations.** To annotate a `Repr` `r` (that *MUST NOT* itself already be annotated) with some sequence of `Value`s `[v_1, ..., v_m]`, surround `r` as follows: