From 1e601a45e6f38891e3467817d87964ce9b4e183c Mon Sep 17 00:00:00 2001 From: Tinnus Napbus Date: Tue, 1 Aug 2023 23:28:01 +1200 Subject: [PATCH] clarify term/knot are not ASCII in general --- content/guides/core/hoon-school/J-stdlib-text.md | 6 +++--- content/reference/hoon/auras.md | 6 +++--- content/reference/hoon/stdlib/2q.md | 9 +++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/content/guides/core/hoon-school/J-stdlib-text.md b/content/guides/core/hoon-school/J-stdlib-text.md index 4eb5d8e..897b8ee 100644 --- a/content/guides/core/hoon-school/J-stdlib-text.md +++ b/content/guides/core/hoon-school/J-stdlib-text.md @@ -14,8 +14,8 @@ We've incidentally used `'messages written as cords'` and `"as tapes"`, but asid There are four basic ways to represent text in Urbit: - `@t`, a `cord`, which is an atom (single value) -- `@ta`, a `knot` or ASCII text, which is an atom (single value) -- `@tas`, a `term` or ASCII text symbol +- `@ta`, a `knot` used for URL-safe path elements, which is an atom (single value) +- `@tas`, a `term` used primarily for constants, which is an atom (single value) - `tape`, which is a `(list @t)` This is more ways than many languages support: most languages simply store text directly as a character array, or list of characters in memory. Colloquially, we would only call cords and tapes [_strings_](https://en.wikipedia.org/wiki/String_%28computer_science%29), however. @@ -75,7 +75,7 @@ There are some tools to work with atom `cord`s of text, but most of the time it We've hinted a bit at the structure of `list`s before; for now the main thing you need to know is that they are cells which end in a `~` sig. So rather than have all of the text values stored sequentially in a single atom, they are stored sequentially in a rightwards-branching binary tree of cells. -A tape is a list of `@tD` atoms (i.e., ASCII characters). (The upper-case character at the end of the aura hints that the `@t` values are D→3 so 2³=8 bits wide.) +A tape is a list of `@tD` atoms (i.e., characters). (The upper-case character at the end of the aura hints that the `@t` values are D→3 so 2³=8 bits wide.) ```hoon > "this is a tape" diff --git a/content/reference/hoon/auras.md b/content/reference/hoon/auras.md index ab706e9..ae98566 100644 --- a/content/reference/hoon/auras.md +++ b/content/reference/hoon/auras.md @@ -38,8 +38,8 @@ Aura Meaning Example Literal Syntax @sw signed base64 --0wbnC.8haTg @sx signed hexadecimal -0x5f5.e138 @t UTF-8 text (cord) 'howdy' - @ta ASCII text (knot) ~.howdy - @tas ASCII text symbol (term) %howdy + @ta URL-safe path element text (knot) ~.howdy + @tas short name text (term) %howdy @u unsigned integer @ub unsigned binary 0b11.1000 @ud unsigned decimal 1.000.056 @@ -55,7 +55,7 @@ two, starting from A. ``` @udD unsigned single-byte (8-bit) decimal - @tD 8-bit ASCII text + @tD 8-bit UTF-8 text @rhE half-precision (16-bit) floating-point number @uxG unsigned 64-bit hexadecimal @uvJ unsigned, 512-bit integer (frequently used for entropy) diff --git a/content/reference/hoon/stdlib/2q.md b/content/reference/hoon/stdlib/2q.md index e7c19ab..fa16398 100644 --- a/content/reference/hoon/stdlib/2q.md +++ b/content/reference/hoon/stdlib/2q.md @@ -51,8 +51,8 @@ usage = "stdlib" slug = "#flag" desc = "Used in the Hoon standard library." -[glossaryEntry."Atom type of ASCII characters"] -name = "Atom type of ASCII characters" +[glossaryEntry."Atom type for URL-safe path element text"] +name = "Atom type for URL-safe path element text" symbol = "knot" usage = "stdlib" slug = "#knot" @@ -346,9 +346,10 @@ See also: [`year`](/reference/hoon/stdlib/3c#year), [`yore`](/reference/hoon/std ## `+$knot` -ASCII text +URL-safe path element text -An atom type that only permits ASCII characters. +An atom type that only permits lower-case letters, numbers, and four +special characters: hyphen, tilde, underscore and period. #### Source