Fill out the technical index, and let each object answer for its own entry - #55
Merged
Conversation
The index answered every lookup the same way: it announced that an entry had appeared on the screen, and then either printed one or said the entry was corrupted. Looking up the quarter therefore produced an entry that had come up on the screen and been damaged, when what the library really had to say about a quarter was nothing at all. Entries now hand their text back instead of printing it, which is what lets 'look up' find out whether there is one before announcing that anything has appeared. A subject with no branch falls out as UNDEFINED, and that is the whole of "the library doesn't cover it" -- so the bicycle repair kit and the quarter need no branch apiece saying so. Eighteen entries join the five that were there. Several carry a clue that the game otherwise leaves to be discovered by dying: that the counter reads the room and not the wearer, so coveralls do not turn the light green; that welding light blinds at once rather than by degrees; that the airlock does not check whether anyone is ready. The rest are there because a library with five entries is not a library. Also here, all in the room being worked on: - The cartridges are an object now. They were the first noun in the room description and the only one that could not be looked at. - never_read was set TRUE and never cleared, so the index introduced itself as if for the first time however often it was read. - "the walls are lines with", "artifical", "physican".
The entries were a case statement over main.subj: a dispatch table written by hand, which is the one thing an object language should not need. It could also only ever yield text, so an entry had no way to give a hint that depended on anything, or to have any effect at all. Objects answer 'TechnicalIndexLookup' for themselves now. Whether the library covers a subject is the subject's own business, and an unhandled message comes back ABSENT, which is the whole of "not covered" -- the bicycle repair kit and the quarter are left out by having nothing written about them anywhere, rather than by being named in a default branch. The same test the parser already uses on 'look' in gorreven_lex. Sending is also the asking, so an entry has printed itself by the time the answer arrives. The announcement therefore names the subject and promises nothing about what follows, which is true either way and has the side benefit of showing which object a word landed on. Two entries now say different things depending on the state of the thing they describe, which is the point of the change: the Geiger counter adds a note when it is switched off, and the calculator stops hinting at its back cover once the back cover is off. The entries themselves are >> text rather than concatenated string literals, so they read as prose in the source as well as on the screen. Examining the vending machine now prints its terms. The coin goes in and does not come out, and there is exactly one coin aboard; the trap stays, but a player standing in front of the machine can read NO REFUNDS, NO CHANGE GIVEN, ALL SALES FINAL before deciding. That is the difference between a mean puzzle and an unfair one.
Also a stylistic change to model "wall of text" wiki-style expressions as single statements, usually aligned against the left edge of the editor. These are text more than they are code, and I like them to read that way in those contexts. Also made a change throughout starship.arch to use `---` as my em dash instead of ` -- ` and especially more than ` - `, in anticipation of markdown work. I haven't checked how that impacts word-wrap.
Two spellings: the Geiger counter reported "radation", and the spent fuel block compared itself to "unspect" fuel. The spacesuit entry began "This standard out-of-ship equipment is comprised primarily of this rubber and vinyl spacesuit", the second "this" left over from promoting the first word. It is "a" spacesuit now. Braces came off two entries that the pass had left behind: lead_waste and the index's own INDEX: see INDEX. Both are a single chained >> statement like the rest, so the block was doing nothing. The Geiger counter keeps its braces, the trailing conditional making it genuinely two statements. The reactor entry had a source line one column past eighty; rewrapped. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Ui8UMgev1U8LW5iyQdSsJ
gitosaurus
force-pushed
the
feat/tech-index-entries
branch
from
August 13, 2026 02:19
c5355b1 to
df1bed9
Compare
The note about ">>" chaining into a single statement is three more lines of prose inside a method, and prose inside a method is 157 bytes of the binary. Nothing about the format moved. The .ttl is unchanged, byte for byte, which is the whole story: the RDF dump describes the world -- objects, attributes, who is inside what -- and a string literal in a method body is none of those things. The reviewable half of this diff being empty is the evidence that only the opaque half should have changed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Ui8UMgev1U8LW5iyQdSsJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Takes up More entries for the technical index from the roadmap.
How lookup works now
The entries were a
caseovermain.subj— a dispatch table written by hand,which is the one thing an object language shouldn't need — and it could only
ever yield text, so an entry had no way to give a conditional hint or to have
any effect at all.
Objects answer
'TechnicalIndexLookup'for themselves now. Whether the librarycovers a subject is the subject's own business, and an unhandled message comes
back
ABSENT, which is the whole of "not covered": the bicycle repair kit andthe quarter are left out by having nothing written about them anywhere, rather
than by being named in a default branch. Same test the parser already uses on
'look'ingorreven_lex.arch:46.Sending is also the asking, so an entry has printed itself by the time the
answer arrives. The announcement therefore names the subject and promises
nothing about what follows — true either way, and it shows which object a word
landed on:
Entries are
>>text rather than concatenated string literals, so they read asprose in the source as well as on the screen.
Verified, not assumed: several types define a
defaultthat forwards amessage on rather than letting it fall off the end (
hollow_objectforwards toroom,large_structureforwards tohollow_object), so "no handler" is notautomatically ABSENT for every type. A sweep of every
IsAobjectin the gamefound exactly one non-ABSENT responder — the
objectclass prototype itself,which is not a thing a player can name. Also confirmed that a method ending in
an
ifthat doesn't fire returns UNDEFINED and not ABSENT, so a conditionalentry can't print itself and then be denied in the same breath.
The entries
Eighteen added to the five that were there — power, EVA kit, radiation, ship
systems, and a few odds and ends. Several carry a clue the game otherwise
leaves to be found by dying:
turn the light green;
The rest are flavour, which the roadmap explicitly allows: "Most items! They
don't all have to have clues."
Two entries now depend on the state of what they describe, which is the point
of the restructure: the Geiger counter adds a note when it's switched off, and
the calculator stops hinting at its back cover once the back cover is off.
The corrupted message survives, moved to the one place a damaged entry says
something: the captain's ID card.
Also in this PR
calculator and buys the drink, and the machine keeps whatever it's given,
so spending it first is unrecoverable and nothing said so beforehand. The
trap stays as designed; what it lacked was the notice any machine of this
kind would have printed on it. (This rode along in
c5355b1, whose messagedoesn't mention it.)
description and the only one that couldn't be looked at.
never_readwas never cleared, so the index introduced itself as if forthe first time however often it was read.
"physican".
Testing
--test: 18 suites, 0 failures. Every entry verified reachable by the name aplayer would type, from a scratch harness that starts in the library, including
both branches of each conditional entry.