Skip to content

The one-clause page shows the refusal it claims - #44

Merged
onatozmenn merged 1 commit into
mainfrom
demo-shows-what-it-claims
Aug 9, 2026
Merged

The one-clause page shows the refusal it claims#44
onatozmenn merged 1 commit into
mainfrom
demo-shows-what-it-claims

Conversation

@onatozmenn

Copy link
Copy Markdown
Contributor

The heading on this section says:

A host without Io.save refuses the second module, before any of it runs.

The snippet under it did something else. It ran the module with no host at
all
and read whichever import execution reached first, which for both of
these modules is deed:io.read — the operation they share, not the clause that
is the difference between them. A host behaving that way would have read the
file before noticing it could not save.

Measured and fixed on the compiler side in
deed-lang/deed#964, where the
test named for save turned out never to mention save.

What this page shows now

Host::link reads the whole import section and answers before an instruction
runs, which is what the heading claims:

let mut host = Host::new();
host.offer("deed:io", "read", |_| Ok(Some(Value::I64(0))));

let refused = host
    .link(&module_for("read_write.deed"))
    .expect_err("a host that cannot save should refuse the module that saves");

assert_eq!(refused.name, "save");

And the other half, which is what makes the first half mean anything: the same
host links the read-only module and hands it back ready to call. A host that
refused both would be a host with no filesystem.

The transcript

Five tests, one of which no longer exists, becomes seven. The compiler's
repository now reads that list back out of demo/README.md and compares it to
the tests the file declares, so this page and that one cannot drift apart
quietly again.

node tools/check.mjs: 72 files, every link resolves, and v0.2.10 loaded and
answered about all 29 examples.

The page's own heading says "A host without `Io.save` refuses the second
module, before any of it runs." The snippet under it ran the module with no
host at all and read whichever import execution reached first, which for both
of these modules is `deed:io.read` — the operation they share, not the clause
that is the difference. Measured in deed-lang/deed#964.

`Host::link` reads the whole import section and answers before an instruction
runs, which is what the heading says, so that is what the page shows now. The
other half is on the page too: the same host links the read-only module and
hands it back ready to call. A host that refused both would be a host with no
filesystem and would say nothing about the clause.

The test transcript further down was five tests and named one that no longer
exists. It is seven now, and the compiler's repository reads that list back out
of `demo/README.md` on every commit, so this page and that one cannot drift
apart quietly again.
@onatozmenn
onatozmenn merged commit 0efe2bf into main Aug 9, 2026
1 check passed
@onatozmenn
onatozmenn deleted the demo-shows-what-it-claims branch August 9, 2026 16:33
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