apl: glyph audit — ⍉ ⊢ ⊣ ⍕ wired (+6 tests, Phase 9 complete)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 54s

Glyph parser saw these but runtime had no mapping:
- ⍉ monadic + dyadic transpose (apl-transpose, apl-transpose-dyadic)
- ⊢ monadic identity / dyadic right (returns ⍵)
- ⊣ monadic identity / dyadic left (returns ⍺)
- ⍕ alias for ⎕FMT

Pipeline 99/99.  All Phase 9 items ticked.

Remaining gaps (next phase): ⊆ partition, ∪ unique, ∩ intersection,
⍸ where, ⊥ decode, ⊤ encode, ⍎ execute — parser recognises
them but runtime not yet implemented.
This commit is contained in:
2026-05-07 23:50:28 +00:00
parent f5d3b1df19
commit 69078a59a9
3 changed files with 37 additions and 1 deletions

View File

@@ -431,3 +431,27 @@
(file-read "lib/apl/tests/programs/primes.apl")
" ⋄ primes 100"))))
25)
(apl-test
"⍉ monadic transpose 2x3 → 3x2"
(mkrv (apl-run "⍉ (2 3) 6"))
(list 1 4 2 5 3 6))
(apl-test
"⍉ transpose shape (3 2)"
(mksh (apl-run "⍉ (2 3) 6"))
(list 3 2))
(apl-test "⊢ monadic identity" (mkrv (apl-run "⊢ 1 2 3")) (list 1 2 3))
(apl-test
"5 ⊣ 1 2 3 → 5 (left)"
(mkrv (apl-run "5 ⊣ 1 2 3"))
(list 5))
(apl-test
"5 ⊢ 1 2 3 → 1 2 3 (right)"
(mkrv (apl-run "5 ⊢ 1 2 3"))
(list 1 2 3))
(apl-test "⍕ 42 → \"42\" (alias for ⎕FMT)" (apl-run "⍕ 42") "42")

View File

@@ -40,6 +40,10 @@
((= g "⍋") apl-grade-up)
((= g "⍒") apl-grade-down)
((= g "?") apl-roll)
((= g "⍉") apl-transpose)
((= g "⊢") (fn (a) a))
((= g "⊣") (fn (a) a))
((= g "⍕") apl-quad-fmt)
((= g "⎕FMT") apl-quad-fmt)
((= g "⎕←") apl-quad-print)
(else (error "no monadic fn for glyph")))))
@@ -83,6 +87,9 @@
((= g "~") apl-without)
((= g "/") apl-compress)
((= g "⌿") apl-compress-first)
((= g "⍉") apl-transpose-dyadic)
((= g "⊢") (fn (a b) b))
((= g "⊣") (fn (a b) a))
(else (error "no dyadic fn for glyph")))))
(define

View File

@@ -218,10 +218,14 @@ Today they are documentation; we paraphrase the algorithms in
_(primes.apl runs as-written with ⍵-rebind now supported. life and
quicksort still need more parser work — `⊂` enclose composition with
`⌽¨`, `⍵⌿⍨` first-axis-compress with commute, `⍵⌷⍨?≢⍵`.)_
- [ ] **Audit silently-skipped glyphs** — sweep `apl-glyph-set` and
- [x] **Audit silently-skipped glyphs** — sweep `apl-glyph-set` and
`apl-parse-fn-glyphs` against the runtime's `apl-monadic-fn` and
`apl-dyadic-fn` cond chains to find any that the runtime supports
but the parser doesn't see.
_(Wired ⍉ → apl-transpose / apl-transpose-dyadic, ⊢ identity,
⊣ left, ⍕ as alias for ⎕FMT. ⊆ ∩ ⍸ ⊥ ⍎ remain unimplemented
in the runtime — parser sees them as functions but eval errors;
next-phase work.)_
## SX primitive baseline
@@ -237,6 +241,7 @@ data; format for string templating.
_Newest first._
- 2026-05-07: Phase 9 step 6 — glyph audit. Wired ⍉ → apl-transpose/apl-transpose-dyadic, ⊢ → monadic+dyadic identity-right, ⊣ → identity-left, ⍕ → apl-quad-fmt. +6 tests; **Phase 9 complete, all unchecked items ticked**; pipeline 99/99
- 2026-05-07: Phase 9 step 5 — primes.apl runs as-written end-to-end. Added ⍵/ inline-assign in parser :glyph branch + :name lookup falls back from "⍵"/"" key to "omega"/"alpha". `apl-run "primes ← {(2=+⌿0=⍵∘.|⍵)/⍵←⍳⍵} ⋄ primes 50"` → 15 primes. +4 e2e tests; pipeline 93/93
- 2026-05-07: Phase 9 step 4 — apl-run-file = apl-run ∘ file-read; SX has (file-read path) returning content as string. primes/life/quicksort .apl files now load and parse end-to-end (return :dfn AST). +4 tests
- 2026-05-07: Phase 9 step 3 — `?N` random / roll. Top-level mutable apl-rng-state with LCG; apl-rng-seed! for deterministic tests; apl-roll wraps as scalar in 1..N. apl-monadic-fn maps "?" → apl-roll. +4 tests (deterministic with seed 42, range checks)