Просмотр исходного кода

docs: refresh CALC ladder state for the forward rung

Eric Streit 5 дней назад
Родитель
Сommit
11f2ff66b9
3 измененных файлов с 30 добавлено и 29 удалено
  1. 14 15
      CALC-COMPILE.md
  2. 7 8
      SUMMARY.md
  3. 9 6
      shell/tests/fixtures/calc_ladder.tsv

+ 14 - 15
CALC-COMPILE.md

@@ -198,15 +198,15 @@ stripped.
 | array typed constant `XPOS : array[…] of Integer = (…)` | `CALC.PAS:137` | **done (Stage 8)** — code-resident |
 | array typed constant `XPOS : array[…] of Integer = (…)` | `CALC.PAS:137` | **done (Stage 8)** — code-resident |
 | array **element** access `b[i]` (constant index), `r.f` | `t14`, `t65` | **done** — width on the expression |
 | array **element** access `b[i]` (constant index), `r.f` | `t14`, `t65` | **done** — width on the expression |
 | array **element** access with a VARIABLE index `Sheet[fx,fy]`, `with` | 13 `with` sites | `ENoLib` — scaled addressing next |
 | array **element** access with a VARIABLE index `Sheet[fx,fy]`, `with` | 13 `with` sites | `ENoLib` — scaled addressing next |
-| array indexed by an **enum type** | `CALC.INC:773,927` | `ERR 41` |
-| pointers `^Pages`, `New`, `Dispose` | `CALC.INC:579,587,639,690` | `ERR 41` |
+| array indexed by an **enum type** | `CALC.INC:773,927` | **done** — `t100_realexpr` prerequisites |
+| pointers `^Pages`, `New`, `Dispose` | `CALC.INC:579,587,639,690` | **done** — `t93_pointer` |
 | string **value** parameters (`S : AnyString`) | `CALC.INC:17`, … | **done** — whole-slot copy; `t67_strparam` |
 | string **value** parameters (`S : AnyString`) | `CALC.INC:17`, … | **done** — whole-slot copy; `t67_strparam` |
-| `var` parameters | 10 routines, 14 occurrences (e.g. `CALC.INC:765,979,995,1036`) | **silently by value** |
-| self-recursion | `Fact` — `Fact := I * Fact(I - 1)`, `CALC.INC:747,754` | `ERR 1` at the `(` |
-| mutual recursion via `forward` | `Expression` fwd `CALC.INC:742` ↔ `Factor` calls it at `820`,`932` | `forward` parses; definition untested |
-| forward definition repeating only the name | `CALC.INC:1036` (params commented out) | to check |
+| `var` parameters | 10 routines, 14 occurrences (e.g. `CALC.INC:765,979,995,1036`) | **done** — by reference, `t73_varparam` |
+| self-recursion | `Fact` — `Fact := I * Fact(I - 1)`, `CALC.INC:747,754` | **done** — `t101_recursion` |
+| mutual recursion via `forward` | `Expression` fwd `CALC.INC:742` ↔ `Factor` calls it at `820`,`932` | **done** — `t107_forward` |
+| forward definition repeating only the name | `CALC.INC:1036` (params commented out) | **done** — `t107_forward` |
 | nested procedures / functions | `DisplayMessage` in `Help`; `Fact`/`Factor` in `Evaluate` | parses OK |
 | nested procedures / functions | `DisplayMessage` in `Help`; `Fact`/`Factor` in `Evaluate` | parses OK |
-| local `type`/`const`/`var` sections in a nested function | `CALC.INC:767-778` | `ERR 41`/`ERR 102` |
+| local `type`/`const`/`var` sections in a nested function | `CALC.INC:767-778` | **done** — needed by Factor |
 | `case` labels `^E`, `^X, ^J`, `#27`, comma lists | `CALC.PAS:169`, `CALC.INC:91,1200,1567` | comma lists/`^X`/`#` unknown |
 | `case` labels `^E`, `^X, ^J`, `#27`, comma lists | `CALC.PAS:169`, `CALC.INC:91,1200,1567` | comma lists/`^X`/`#` unknown |
 | `file of CellRec`, `text` | `CALC.PAS:144`, `CALC.INC:582` | **types done (Stage 13)** — operations next |
 | `file of CellRec`, `text` | `CALC.PAS:144`, `CALC.INC:582` | **types done (Stage 13)** — operations next |
 | lexical `#27` and `^M` char constants | many | `ERR 41` at the `#`/`^` |
 | lexical `#27` and `^M` char constants | many | `ERR 41` at the `#`/`^` |
@@ -469,7 +469,7 @@ ladder order (each stage removes the blocker the previous one exposed).
 
 
 ### Session state — where to resume
 ### Session state — where to resume
 
 
-Last touched 2026-10-22. The rungs listed below are landed (Stages 1-4, sets,
+Last touched 2026-10-23. The rungs listed below are landed (Stages 1-4, sets,
 enums, record types, array declarations, element/field access, file types, the
 enums, record types, array declarations, element/field access, file types, the
 calling convention and string value parameters, `Length`, the CRT identifiers,
 calling convention and string value parameters, `Length`, the CRT identifiers,
 `Kbd`, `KeyPressed`, `var` parameters, the CASE labels, variable array
 `Kbd`, `KeyPressed`, `var` parameters, the CASE labels, variable array
@@ -480,12 +480,11 @@ membership, string fields in WRITE, real output, run-time set algebra,
 file control-block operations, VAR string parameters, `Chr`, typed-file
 file control-block operations, VAR string parameters, `Chr`, typed-file
 block I/O, text-file output, `Str`, pointer types with `New`/dereference,
 block I/O, text-file output, `Str`, pointer types with `New`/dereference,
 text `Eof`/`Readln`, integer `Str`, integer `Val`, and VAR REAL parameters). The
 text `Eof`/`Readln`, integer `Str`, integer `Val`, and VAR REAL parameters). The
-ladder has moved from the first typed constant at 7,791 to **35,135**, where
-The real functions `Ln`, `Exp`, `Sin`, `Cos` and `Arctan` are landed.  The
-forward definition `function Expression{(...):Real;forward};` is also accepted:
-the definition may repeat only the name, and the forward's formal symbols are
-made visible for its body again (`t107_forward`).  The ladder now stops at
-`delete(Formula,1,1)` in `Evaluate`.
+ladder has moved from the first typed constant at 7,791 to **44,567**, where
+`delete(Formula,1,1)` asks for the `Delete` string builtin.  Copy, real `Val`,
+the REAL functions (`Abs`, `Sqr`, `Sqrt`, `Ln`, `Exp`, `Sin`, `Cos`,
+`Arctan`) and forward definitions that repeat only the name (`t107_forward`)
+are landed.
 
 
 The rung commits and their tags, in order (each is one rung with its own
 The rung commits and their tags, in order (each is one rung with its own
 fixture, red proof, and — where the harness allows — execution under qemu and
 fixture, red proof, and — where the harness allows — execution under qemu and
@@ -535,7 +534,7 @@ Exec86):
 | `30782f6` | `v-TP3-CALC-REALEXPR` | `ERR 41 35135` (`Copy`) |
 | `30782f6` | `v-TP3-CALC-REALEXPR` | `ERR 41 35135` (`Copy`) |
 | `df54e71` | `v-TP3-CALC-COPYVAL` | `ERR 41 40930` (`Exp`) |
 | `df54e71` | `v-TP3-CALC-COPYVAL` | `ERR 41 40930` (`Exp`) |
 | `dcfbf8c` | `v-TP3-CALC-TRANSCEND` | `ERR 41 43902` (forward definition) |
 | `dcfbf8c` | `v-TP3-CALC-TRANSCEND` | `ERR 41 43902` (forward definition) |
-| *(this commit)* | `v-TP3-CALC-FORWARD` | **`ERR 41 44567`** (`Delete`) |
+| `21ce8e5` | `v-TP3-CALC-FORWARD` | **`ERR 41 44567`** (`Delete`) |
 
 
 - **Code HEAD** is the layout rung (`v-TP3-CALC-LAYOUT`).  Nothing is pushed.
 - **Code HEAD** is the layout rung (`v-TP3-CALC-LAYOUT`).  Nothing is pushed.
   The terminal-config work (`v-TP3-TERMCFG`) and the editor key map
   The terminal-config work (`v-TP3-TERMCFG`) and the editor key map

+ 7 - 8
SUMMARY.md

@@ -2063,14 +2063,13 @@ type (`t87`), file control-block operations (`t88`: `Assign`/`Reset`/
 parameters plus `Chr` (`t89`), typed-file block I/O (`t90`, compile-only), and
 parameters plus `Chr` (`t89`), typed-file block I/O (`t90`, compile-only), and
 text-file output (`t91`, compile-only), `Str` real formatting (`t92`), and
 text-file output (`t91`, compile-only), `Str` real formatting (`t92`), and
 pointer types with `New`/`Dispose`/dereference (`t93`), text `Eof`/`Readln`
 pointer types with `New`/`Dispose`/dereference (`t93`), text `Eof`/`Readln`
-(`t94`), integer `Str` (`t95`), and integer `Val` (`t96`). The next rung is
-REAL function results (`t98`), value REAL parameters (`t99`), REAL
-literals/comparisons/arithmetic (`t100`) and self-recursion (`t101`). The next
-rung is the `Delete` string builtin; forward definitions that repeat only the
-name and all REAL builtins used by CALC are landed.  The runtime is 13,955
-bytes / 54 entries; the rt_exec scaffold moved to HDR=0x4000 / data 0x5000.
-Items 1-4
-below are independent of both tracks.
+(`t94`), integer `Str` (`t95`), and integer `Val` (`t96`).  REAL function results, value REAL parameters, REAL
+literals/comparisons/arithmetic, self-recursion, `Copy`, real `Val`, the REAL
+standard functions (`Abs`, `Sqr`, `Sqrt`, `Ln`, `Exp`, `Sin`, `Cos`,
+`Arctan`), `Int(REAL)` and forward definitions that repeat only the name are
+landed.  The ladder now stops at the `Delete` string builtin (`ERR 41 44567`).
+The runtime is 13,955 bytes / 54 entries; the rt_exec scaffold is at
+HDR=0x4000 / data 0x5000.  Items 1-4 below are independent of both tracks.
 
 
 1. The rest of the string language. `v-TP3-STRVAR`/`v-TP3-STRREAD-ASSIGN` cover
 1. The rest of the string language. `v-TP3-STRVAR`/`v-TP3-STRREAD-ASSIGN` cover
    string variables, `s := 'literal'`, `writeln (s)`, `readln (s)`/`read (s)`
    string variables, `s := 'literal'`, `writeln (s)`, `readln (s)`/`read (s)`

+ 9 - 6
shell/tests/fixtures/calc_ladder.tsv

@@ -25,15 +25,18 @@
 # positions shift — which is exactly why this must be a measured number, not a
 # positions shift — which is exactly why this must be a measured number, not a
 # remembered one.
 # remembered one.
 #
 #
-# Current rung (2026-10-23): `Copy(Formula,...)' inside Factor's real Val.
+# Current rung (2026-10-23): `delete(Formula,1,1)' in Evaluate.
 # UpCase, run-time set membership, string fields through DI, the original memory
 # UpCase, run-time set membership, string fields through DI, the original memory
 # layout, untyped-file declarations, file control-block operations, VAR string
 # layout, untyped-file declarations, file control-block operations, VAR string
 # parameters, Chr, typed-file block I/O, text-file output, Str,
 # parameters, Chr, typed-file block I/O, text-file output, Str,
 # pointers/New/dereference, text Eof/Readln, Str(integer), Val(integer), VAR/
 # pointers/New/dereference, text Eof/Readln, Str(integer), Val(integer), VAR/
 # value REAL and REAL function results, REAL literals/comparisons/arithmetic,
 # value REAL and REAL function results, REAL literals/comparisons/arithmetic,
-# self-recursion, enum-indexed arrays, string-array typed constants and local
-# REAL variables moved the ladder 15911 -> 18267 -> 19847 -> 20912 -> 22253 ->
-# 22280 -> 22706 -> 22859 -> 23700 -> 25674 -> 26066 -> 26924 -> 27648 ->
-# 28074 -> 31758 -> 32096 -> 32284 -> 32482 -> 32564 -> 33374 -> 33537 ->
-# 33778 -> 35135.  The next blocker is the Copy string builtin (TP3 error 41).
+# self-recursion, enum-indexed arrays, string-array typed constants, local REAL
+# variables, Copy, real Val, Abs/Sqr/Sqrt, Ln/Exp/Sin/Cos/Arctan, Int(REAL) and
+# forward definitions that repeat only the name moved the ladder 15911 -> 18267
+# -> 19847 -> 20912 -> 22253 -> 22280 -> 22706 -> 22859 -> 23700 -> 25674 ->
+# 26066 -> 26924 -> 27648 -> 28074 -> 31758 -> 32096 -> 32284 -> 32482 ->
+# 32564 -> 33374 -> 33537 -> 33778 -> 35135 -> 36054 -> 39987 -> 40263 ->
+# 40930 -> 41118 -> 41595 -> 43902 -> 44567.  The next blocker is the Delete
+# string builtin (TP3 error 41).
 CALC.PAS	ERR	41	44567
 CALC.PAS	ERR	41	44567