mirror of
https://github.com/urbit/developers.urbit.org.git
synced 2024-08-17 01:30:31 +03:00
clarify term/knot are not ASCII in general
This commit is contained in:
parent
406ceee464
commit
1e601a45e6
@ -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"
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user