Expand description
The calculator’s text for objects: numbers in the display mode, data objects as the stack shows them, programs, algebraics (infix) and unit expressions rebuilt from their elements.
The rules (number formats, spacing, the operators’ precedence and
parentheses) are those the ROM’s own decompiler shows, checked against
it by the ROM-gated oracle test (saturnus-kermit e2e,
decompiler_matches_the_rom); wiki: protocols/rpl-libraries for how
commands are named.
Text is capped at MAX_TEXT characters; longer text ends in
TRUNCATED. The texts described adds are capped together at
MAX_DESCRIBED_TEXT.
Structs§
- Settings
- The display settings the text depends on.
Enums§
- Number
Format - How reals are shown (flags -49 and -50, digits in -45 to -48).
Constants§
- MAX_
DESCRIBED_ TEXT - Most characters of
textfields onedescribedcall (one stack read) adds. Every object inside another carries its own text, so a string nested 64 levels deep is written 64 times: the decode budget bounds the objects, this bounds the copies of their text. 4 M characters, a few MB of JSON; the 49G’s whole RAM (256 KB) holds at most 256 K characters of strings. - MAX_
TEXT - Longest text produced for one object, in characters.
- TRUNCATED
- Appended to text cut at
MAX_TEXT.
Functions§
- described
objas JSON (its serde shape) with the calculator’s own text in atextfield on the object and on every object inside it (a list’s items, a tagged object’s object, an array’s elements), each as it is written in that place; notextwhere there is none (has_text). A front end shows and copies these texts and formats nothing itself. An error pastMAX_DESCRIBED_TEXTcharacters of text.- display
objas the stack shows it as a whole level.- edit_
text - Text of
objto edit and compile again (the palette’s editor), in settings made bySettings::for_editing:text, but a tagged object as:tag:object, which compiles. An error for an object with no such text: a part without text (has_text), a string holding"(the calculator has no way to write one), or text cut atMAX_TEXT. - has_
text - Whether the calculator’s text of
objis known in full: every program, algebraic and unit inside it was decompiled and every command has a name (or is an XLIB name, shown by its numbers). - text
- The calculator’s text of
objas a whole stack level or a variable’s value (display; a name with its quotes, as the stack shows one), orNoneif a part of it has none (has_text).