cl: Phase 6 FORMAT + substr fixes — 514/514 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 39s

FORMAT with ~A/~S/~D/~F/~%/~&/~T/~P/~{...~}/~^; cl-fmt-loop,
cl-fmt-find-close, cl-fmt-iterate, cl-fmt-a/cl-fmt-s helpers.
Fix substr(start,length) semantics throughout: SUBSEQ end formula
corrected to (- end start), cl-fmt-loop char extraction fixed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-05 12:23:54 +00:00
parent 025ddbebdd
commit 4f9da65b3d
5 changed files with 176 additions and 8 deletions

View File

@@ -234,6 +234,32 @@
(ev "(subseq \"hello\" 2)")
"llo")
;; ── FORMAT ─────────────────────────────────────────────────────────
(check "format ~A"
(ev "(format nil \"hello ~A\" \"world\")")
"hello world")
(check "format ~D"
(ev "(format nil \"~D items\" 42)")
"42 items")
(check "format two args"
(ev "(format nil \"~A ~A\" 1 2)")
"1 2")
(check "format ~A+~A=~A"
(ev "(format nil \"~A + ~A = ~A\" 1 2 3)")
"1 + 2 = 3")
(check "format iterate"
(ev "(format nil \"~{~A~}\" (quote (1 2 3)))")
"123")
(check "format iterate with space"
(ev "(format nil \"(~{~A ~})\" (quote (1 2 3)))")
"(1 2 3 )")
;; ── summary ──────────────────────────────────────────────────────
(define stdlib-passed passed)