feat(v4): v3's whole POST, Task 8 round -- the rules, and v4 where the rulings put it (#189)
v3's whole POST on v4 at 983 of 1010 (the table's own count with its drops), from 850.
What remains is capacity ("Dictionary full", the 100-900-deep stacks): next, as ruled.
Found and fixed under the rulings (docs/v4.0.0/POST-PARITY.md):
- IS and DEFER@ refuse a word DEFER did not make, as v3: error 22, "Not deferred".
v4's IS stored into any word -- POST's `42 IS DUP` broke DUP for every case after it.
DEFER marks its word with flag 128 (dict.f18).
- SMUDGE and HIDDEN are compile-only, as v3's table: at the prompt v4's hid the newest word.
- Q./ by zero gives 0 and no error (ruled: v3's table); error 11 retired. The ROM's,
the test's reference and its hand-assembled copy changed alike.
- FENCE is v3's: it protects what is defined so far. The variable is (FENCE).
- The line's length is (#SRC), no longer SPAN: an EXPECT in a line cut the rest of
the line off, and 0 EXPECT could not leave SPAN 0 (FORTH-83).
- POST gains V4_POST_HEAD: the values left and how the output begins -- the form of a
printout whose values are the run's own (TOP-WORDS, WORD-ENTROPY).
post_all_rules.py: the rest of the whole table where it is not taken as v3 ran it --
v4's units for the cases that wrote through HERE as a byte address (CMOVE>, BLANK,
ERASE, FILL wrote into the system's code), the standard's results (COMPARE, SEARCH,
BASE output, THRU, >BODY with FIND's address), v3's descriptions where v3 printed
otherwise, and the cases dropped with their reasons (SP@/SP! by D-2, DABS/DMIN
underflow, CMOVE>.bounds, THRU.negative_end).
make -C v4 test: all v4 tests passed (both widths, mesh-boot, inference).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
@@ -175,11 +175,11 @@ EXECUTE ( xt -- ) Run the word whose execution token is xt.
|
||||
EXIT ( -- ) Compile-only: return from the definition at this point.
|
||||
EXPECT ( baddr n -- ) Read up to n characters, or a line, from the terminal into baddr; SPAN holds how many.
|
||||
FALSE ( -- 0 ) Constant: the false flag, zero.
|
||||
FENCE ( -- addr ) Variable: FORGET will not remove anything below the address it holds.
|
||||
FENCE ( -- ) As v3: FORGET will not remove anything defined so far (the fence is raised to HERE).
|
||||
FILL ( baddr u c -- ) Fill u bytes from baddr with the byte c.
|
||||
FIND ( -- xt | 0 ) FIND xxx: the execution token of xxx, from the input stream, or 0 if it is not found.
|
||||
FLUSH ( -- ) Write every changed block (SAVE-BUFFERS).
|
||||
FORGET ( -- ) FORGET xxx: remove xxx and every word defined after it, never below FENCE.
|
||||
FORGET ( -- ) FORGET xxx: remove xxx and every word defined after it, never below the fence (FENCE).
|
||||
FORTH ( -- ) Make FORTH, the primary vocabulary, the CONTEXT vocabulary.
|
||||
FREEZE-WORD ( baddr u -- ) The word named stops decaying (its record frozen, in the kernel). Nothing if there is no such word.
|
||||
FROZEN? ( baddr u -- flag ) True if the word named is frozen; false for one that is not, or is not there.
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 11 and column 3.
|
@@ -115,3 +115,28 @@ v3's behaviour -- or its table, where v3 contradicts it -- only for v3's own ext
|
||||
least significant 16 bits is two greater than the address of the most significant 16 bits." FORTH-79 says
|
||||
only "as for a double number" (`2!`). v4's `2!` `2@` `2,` stored the low cell first, "as v3": changed to the
|
||||
high cell at the lower address.
|
||||
|
||||
**Ruled (Captain Bob, 2026-11-14), on four questions from the whole table at 969 of 1018:**
|
||||
- **Capacity: "Enlarge v4 to fit".** Four stress cases push 100 to 900 values (v4's prompt node: 32); 21
|
||||
cases late in the run meet "Dictionary full" (1018 cases defining words in one dictionary; Hera's run-time
|
||||
space about 5.5K cells). The standards ask less (FORTH-79 6.2: a 64-byte data stack, 2000 bytes of
|
||||
dictionary; ANS: 32 cells), but v4 is grown until v3's cases fit.
|
||||
- **`Q./` by zero: "v3's table: q = 0".** No standard defines the Q48 words; v3's table says division by
|
||||
zero yields 0. v4's error 11 ("Division by zero (Q./)") goes.
|
||||
- **`SP@` `SP!`: D-2 stands; `FENCE`: v3's** ("D-2 for SP@; v3 for FENCE"). The six `SP@`/`SP!` cases are
|
||||
dropped: no stack pointer is visible to code (DECOMPOSITION.md D-2). `FENCE` becomes v3's word -- it
|
||||
protects what is defined so far from FORGET -- and the variable FORGET and COLD read is `(FENCE)`.
|
||||
- **SPAN: "Fix it in Phase 7".** v4's interpreter took the line's length from SPAN, so an `EXPECT` in a
|
||||
line cut the rest of the line off, and `0 EXPECT` could not leave SPAN 0 (FORTH-83: SPAN is the count the
|
||||
last EXPECT stored). The line's length gets its own variable.
|
||||
|
||||
Settled under the rulings above, without a question:
|
||||
- `IS` and `DEFER@` refuse a word `DEFER` did not make, as v3 ("was not created by DEFER"): error 22, "Not
|
||||
deferred". v4's IS stored into any word -- `42 IS DUP` broke `DUP` for every case after it.
|
||||
- `SMUDGE` and `HIDDEN` at the prompt are errors, as v3's table (no standard defines them): v4 marks them
|
||||
compile-only. v4's hid the newest word.
|
||||
- `DABS` and `DMIN` given too few values: ANS (8.6.1.1160, 8.6.1.1220) makes stack underflow an ambiguous
|
||||
condition, so there is no error to expect: dropped.
|
||||
- `CMOVE>.bounds` and `THRU.negative_end` dropped (no standard asks for the error); the cases that write
|
||||
through `HERE` as a byte address -- `CMOVE>`, `BLANK`, `ERASE`, `FILL` -- in v4's units (they wrote into
|
||||
the system's code).
|
||||
|
||||
Reference in New Issue
Block a user