Skip to content

Adds a guide to running a statement program - #211

Merged
johnnyt merged 1 commit into
mainfrom
pts-1tr8-how-to-run-a-statement
Oct 5, 2026
Merged

johnnyt merged 1 commit into
mainfrom
pts-1tr8-how-to-run-a-statement

Conversation

@johnnyt

@johnnyt johnnyt commented Oct 5, 2026

Copy link
Copy Markdown
Member

What

A how-to page, docs/guides/how-to-run-a-statement-program.md: compile a renewal script with compileProgram, execute it for a loan with execute and read back the loan it leaves, ask executeValue for the last expression's value, and handle a script that fails. Every example is in the library loan.

The README's Documentation map links the page under Do, in place of the "Statement programs" line that pointed the Do reader at a reference section. That line moves to Look up with a description of what the section holds, the shape the host functions guide took. No other README text changes, and no file under src/ changes.

Source

The docs audit names no span for this subject (its next action for this repository is about the Install section), so the page is written from the README's "Statement programs" reference section and the doc comments on compileProgram, execute and executeValue, and that section stays where it is.

Title

The title "How to run a statement program" is the one the bead's acceptance dictates, kept as given. "run" in it is a verb; it is the page's only use of the word.

Result lines

The suite does not read docs/guides/, so no result line on the page is executed by the suite. Each one was executed by hand against src/ on this branch, with assertions, before the commit:

  • compiled.ok is true
  • compiled.instructions starts ["load", "loan"], ["access", "renewals"], ["lit", 2]
  • the refused script answers "unassignable_location" at { line: 1, column: 19 }
  • the renewed loan's context is { loan: { renewals: 2, days_left: 17 } }
  • the caller's loan.renewals is still 1
  • the refused loan's context carries status: "refused"
  • executeValue answers 17
  • the loan with no days_left fails as "TypeMismatchError" with reason "add"
  • that failure's context is { loan: { renewals: 2 } }

Checks

  • Full gate (mise exec -- pnpm run gate) green on this tree; README.md is a gated path, so the gate ran.
  • The README linter: README.md: 1170 lines, every part present.
  • The page contains no word from the fixture-only domains, and no "run" as a noun.
  • No changelog fragment: changelog.d/README.md excludes documentation.

A how-to page under docs/guides: compile a renewal script, execute it
for a loan and read back the loan it leaves, ask executeValue for the
last expression's value, and handle a script that fails, with the
result each step shows. The README's Documentation map links it under
Do in place of the Statement programs line, which moves to Look up,
where its reference text belongs.

Refs: pts-1tr8
@johnnyt
johnnyt merged commit 0ec3ecf into main Oct 5, 2026
1 check passed
@johnnyt
johnnyt deleted the pts-1tr8-how-to-run-a-statement branch October 5, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant