apl: ⍎ execute — eval string as APL source (+8)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 52s

- apl-execute: reassemble char-vector ravel into single string,
  then apl-run; handles plain string, scalar, and char-vector
- nested ⍎ ⍎ works; ⋄ separator threads through
- pipeline 148/148
This commit is contained in:
2026-05-08 23:00:39 +00:00
parent 015ecb8bc8
commit d1a491e530
3 changed files with 45 additions and 1 deletions

View File

@@ -48,6 +48,7 @@
((= g "⎕←") apl-quad-print)
((= g "⍸") apl-where)
((= g "") apl-unique)
((= g "⍎") apl-execute)
(else (error "no monadic fn for glyph")))))
(define
@@ -574,3 +575,11 @@
(define apl-run (fn (src) (apl-eval-ast (parse-apl src) {})))
(define apl-run-file (fn (path) (apl-run (file-read path))))
(define
apl-execute
(fn
(arr)
(let
((src (cond ((string? arr) arr) ((scalar? arr) (disclose arr)) (else (reduce str "" (get arr :ravel))))))
(apl-run src))))