book: Reference, operators (slice of #590) #625

Open
opened 2026-10-29 21:23:23 +00:00 by orion · 0 comments
Collaborator

Slice of #590 (Reference, part 2), which is a slice of the epic #582. Starts after nothing; #585 is merged. The Guide slices (#587, #588) write book/guide/ and the Reference part 1 slices (#589) write other pages of book/reference/; they are independent of this one and none of them replaces the old pages below. Governing note: book/CONCEPT.md ("How a page is written", "What CI checks"). Touches the seed: no (documentation only; no syntax change, no native, no driver flag, no std name looked up by the compiler).

Goal

Write the Reference page(s) reference/operators.md. Which operator is which trait, how to implement one for your own type, the three operators that are no method call, precedence, bit operators, Index and Slice. Read like book/reference/bindings.md and book/reference/cases-and-patterns.md (merged in #585): complete for the area, still prose with a real program and its output under every rule.

Replaces in docs/

  • docs/language/traits/operators.md

Acceptance criteria

  • Every page has the kind page, status: stable, front matter in the shape of book/reference/bindings.md (title, summary, order, keywords), and is written as book/CONCEPT.md, "How a page is written", says: the first paragraph says in two to four sentences what the page covers, headings name ideas, prose first, no history words, no internal references (no issue numbers, no links into docs/design, docs/contributing, docs/internals, CONCEPT.md), no Related/Next/See also sections, lists of at most seven items, every section starts with a sentence; links only to book pages that exist on main
  • Every trb run and trb error block is followed by its output block with the real output (a trb error block shows what torb check prints, from error: on); no fragments, no // prints comments
  • Every form, rule and compiler error a reader can hit in the area is on the page, as prose with trb run/trb error examples, not as a template of Syntax/Rules/What this is not; Every operator trait is shown on one growing type (for example a vector or money type) with real output; the errors of a missing implementation have trb error examples.
  • The signature features of book/CONCEPT.md that the area touches are shown, not just named
  • book/reference/index.md lists the new page(s) (generated block via torb docs index book); torb docs check book, torb docs index --check book and torb docs site book --check pass, and tools/gates.sh passes in CI
  • The old pages listed under "Replaces in docs/" are deleted in the same PR unless a skill is still built from them (skills are generated by torb docs skill docs skills): for every old page a skill still needs, it stays in docs/ unpublished and the PR description names it and why; the others are deleted together with every link to them, and the skills are regenerated so docs skill --check stays green
  • No other book page is changed except the links that must follow from the deletion; the other Reference slices of #590 are not started

Notes for the implementer

  • Read book/CONCEPT.md, book/reference/bindings.md and the old pages first; run every example with torb before pasting its output. A rule that only the old page states and that you cannot reproduce is checked against the compiler, not copied.
  • Commits: one or two Conventional Commits, for example docs(book): reference operators and, if needed, docs: retire the pages the reference replaces.
  • Size: one PR, 30-40 minutes. Do not write the other Reference pages.
Slice of #590 (Reference, part 2), which is a slice of the epic #582. Starts after nothing; #585 is merged. The Guide slices (#587, #588) write `book/guide/` and the Reference part 1 slices (#589) write other pages of `book/reference/`; they are independent of this one and none of them replaces the old pages below. Governing note: `book/CONCEPT.md` ("How a page is written", "What CI checks"). Touches the seed: no (documentation only; no syntax change, no native, no driver flag, no std name looked up by the compiler). ## Goal Write the Reference page(s) `reference/operators.md`. Which operator is which trait, how to implement one for your own type, the three operators that are no method call, precedence, bit operators, `Index` and `Slice`. Read like `book/reference/bindings.md` and `book/reference/cases-and-patterns.md` (merged in #585): complete for the area, still prose with a real program and its output under every rule. ## Replaces in `docs/` - `docs/language/traits/operators.md` ## Acceptance criteria - [ ] Every page has the kind `page`, `status: stable`, front matter in the shape of `book/reference/bindings.md` (`title`, `summary`, `order`, `keywords`), and is written as `book/CONCEPT.md`, "How a page is written", says: the first paragraph says in two to four sentences what the page covers, headings name ideas, prose first, no history words, no internal references (no issue numbers, no links into `docs/design`, `docs/contributing`, `docs/internals`, `CONCEPT.md`), no Related/Next/See also sections, lists of at most seven items, every section starts with a sentence; links only to book pages that exist on main - [ ] Every `trb run` and `trb error` block is followed by its `output` block with the real output (a `trb error` block shows what `torb check` prints, from `error:` on); no fragments, no `// prints` comments - [ ] Every form, rule and compiler error a reader can hit in the area is on the page, as prose with `trb run`/`trb error` examples, not as a template of Syntax/Rules/What this is not; Every operator trait is shown on one growing type (for example a vector or money type) with real output; the errors of a missing implementation have `trb error` examples. - [ ] The signature features of `book/CONCEPT.md` that the area touches are shown, not just named - [ ] `book/reference/index.md` lists the new page(s) (generated block via `torb docs index book`); `torb docs check book`, `torb docs index --check book` and `torb docs site book --check` pass, and `tools/gates.sh` passes in CI - [ ] The old pages listed under "Replaces in `docs/`" are deleted in the same PR unless a skill is still built from them (skills are generated by `torb docs skill docs skills`): for every old page a skill still needs, it stays in `docs/` unpublished and the PR description names it and why; the others are deleted together with every link to them, and the skills are regenerated so `docs skill --check` stays green - [ ] No other book page is changed except the links that must follow from the deletion; the other Reference slices of #590 are not started ## Notes for the implementer - Read `book/CONCEPT.md`, `book/reference/bindings.md` and the old pages first; run every example with `torb` before pasting its output. A rule that only the old page states and that you cannot reproduce is checked against the compiler, not copied. - Commits: one or two Conventional Commits, for example `docs(book): reference operators` and, if needed, `docs: retire the pages the reference replaces`. - Size: one PR, 30-40 minutes. Do not write the other Reference pages.
Sign in to join this conversation.
No labels
loop
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language#625
No description provided.