The shell runs what it reads, not what a name ends in
A typed word had ".sbx" pasted on the end of it before anything went looking, which is why "notes.txt" sent the shell after a notes.txt.sbx that was never going to exist, and why a script could only be started with "do". The extension was what made a file reachable by name. Now the word as typed is asked for first and the word with the extension on it only after that misses. What comes back is dispatched on what is inside it: SBEX loads and starts, "#!" is read as lines. The loader already refuses anything that is not SBEX and the script reader already refuses anything without the shebang, so the two kinds of runnable file turn each other away and neither has to know the other exists. The suffix can only ever be a second guess, so a file that is really there always beats one that would have to be invented and every program already on a disk still starts by the short name people type for it. It costs a second walk of each directory when a word is not found in it. Tab completion offers a file under the name it actually has, and the suffix stripper is gone: a first word can now be any file at all, and offering only the ones ending .sbx would hide the scripts. The video capture windows moved out a hundred thousand cycles, because starting Lander now walks four names where it walked two. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
co-authored by
Claude Opus 5
parent
4e61158b11
commit
fd962f0084
+9
-2
@@ -1690,8 +1690,15 @@ print(sum(1 for o in range(0, len(px), 3) if px[o:o + 3] == moon))
|
||||
# What is checked is that it is HIGHER LATER: two captures, the second further on, and the
|
||||
# lander nearer the top in the second. A thruster that only fired once for a held button
|
||||
# would let it fall between them instead, which is exactly what the console does.
|
||||
#
|
||||
# ONE AND 1.8 MILLION, and they were 800 thousand and 1.6 million. The shell tries a typed
|
||||
# word as the name of a file before it tries it with ".sbx" on the end, so starting Lander
|
||||
# now walks four names where it walked two, and at 800 thousand the program had not drawn
|
||||
# yet - which reads as row -1 and fails, correctly, for a reason that has nothing to do with
|
||||
# thrusters. The gap between the two captures is what the check is made of, and it is the
|
||||
# same gap.
|
||||
python3 -c "open('$BUILD/lander.pad','wb').write(b'\x00' * 40 + b'\x08' * 400)"
|
||||
for when in 800000 1600000; do
|
||||
for when in 1000000 1800000; do
|
||||
timeout 30 "$EMU" --fast --cycles $when --keyboard "$BUILD/lander.keys" \
|
||||
--pad "$BUILD/lander.pad" --screen "$BUILD/held$when.ppm" \
|
||||
--disk "$ROOT/Tests/build/disks/cosmos.img" --ram-disk 2048 \
|
||||
@@ -1705,7 +1712,7 @@ def top(path):
|
||||
ship = bytes.fromhex('d8c048')
|
||||
ys = [i // 320 for i in range(len(px) // 3) if px[i * 3:i * 3 + 3] == ship]
|
||||
return min(ys) if ys else -1
|
||||
print(top('$BUILD/held800000.ppm'), top('$BUILD/held1600000.ppm'))
|
||||
print(top('$BUILD/held1000000.ppm'), top('$BUILD/held1800000.ppm'))
|
||||
" 2>/dev/null || echo "-1 -1")
|
||||
EOT
|
||||
[ "$EARLY" -gt 0 ] && [ "$LATE" -gt 0 ] && [ "$LATE" -lt "$EARLY" ] \
|
||||
|
||||
Reference in New Issue
Block a user