tcl: Phase 6 — namespace, list ops, dict additions, scan/format, exec [WIP]
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 50s

Phase 6a (namespace `::` prefix):
- tcl-global-ref?/strip-global helpers
- tcl-var-get/set route ::name to root frame
- tokenizer parse-var-sub accepts `::` start so $::var works
- tcl-call-proc forwards :fileevents/:timers/:procs/:commands
- char-at fast-path optimization on var-get/set hot path

Phase 6b (list ops): added lassign, lrepeat, lset, lmap.

Phase 6c (dict additions): added dict lappend, remove, filter -key.

Phase 6d (scan/format):
- printf-spec SX primitive wrapping OCaml Printf via Scanf.format_from_string
- scan-spec SX primitive (manual scanner for d/i/u/x/X/o/c/s/f/e/g)
- Tcl format dispatches via printf-spec; tcl-cmd-scan walks fmt and dispatches

Phase 6e (exec):
- exec-process SX primitive wraps Unix.create_process + waitpid
- Tcl `exec cmd arg...` returns trimmed stdout; raises on non-zero exit

test.sh inner timeout 3600s → 7200s (post-merge JIT recursion is slow).

+27 idiom tests covering ns, list ops, dict, format, scan, exec.

[WIP — full suite verification still pending]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-08 08:28:05 +00:00
parent 63ad4563cb
commit 2fa0bb4df1
5 changed files with 763 additions and 88 deletions

View File

@@ -167,7 +167,9 @@
(begin
(when (= (cur) "}") (advance! 1))
{:type "var" :name name}))))))
((tcl-ident-start? (cur))
((or
(tcl-ident-start? (cur))
(and (= (cur) ":") (= (char-at 1) ":")))
(let ((start pos))
(begin
(scan-ns-name!)