Skip to main content

Module teach

Module teach 

Source
Expand description

The one teaching truth for LOGOS constructs: every lesson a surface shows — LSP hover, completion documentation, the REPL’s :explain — comes from THIS table, so the editor and the terminal always teach the same thing.

A ConstructDoc is complete by construction: the type has no optional teaching fields, so an entry cannot exist without a plain-English sentence, a runnable example, and a socratic question or tip. The doc_for match is wildcard-free (the token_class idiom): adding a TokenType variant does not compile until someone decides whether it deserves a lesson — the decision lives here, next to the enum, not in an editor plugin. doc_for_block is total: every ## block type teaches.

Structs§

ConstructDoc
A complete lesson for one construct. Every field is required by the TYPE — an entry cannot exist without a plain sentence, a runnable example, and a socratic question or tip. Clear-and-easy is structural, not aspirational.
LiterateDoc
One documented definition pulled from a literate LOGOS module.

Statics§

ALL_DOCS
Every lesson, for parity ratchets and the REPL’s suggestion list.

Functions§

doc_for
The lesson for a statement keyword, when the token deserves one.
doc_for_block
The lesson for a ## block header. TOTAL — every block type teaches, and a new BlockType variant does not compile until it gets a lesson.
doc_for_header_at
The documentation for the ## header starting at header_start: the body of a ## Note block IMMEDIATELY above it (the nearest preceding header must be the Note — any other header in between means no doc).
doc_for_primitive
The lesson for a primitive or built-in generic type name.
doc_for_word
The first lesson whose name matches the word, case-insensitively.
docs_for_word
Every lesson whose name matches the word, case-insensitively — a word can name more than one construct (Set the statement, Set the type), and an honest teacher shows both.
extract_literate_docs
Every ## To … / ## A … definition in a literate module, with its ## Note documentation attached where one sits directly above. Types declared inside a ## Definition body inherit the block’s Note.
module_doc
The module-level documentation: the prose between the # Title line and the first ## section (the region the lexer skips).