spec: character type (char? char->integer #\a literals + predicates)

- Add SxChar tagged object {_char, codepoint} to JS platform
- char? char->integer integer->char char-upcase char-downcase
- char=? char<? char>? char<=? char>=? comparators
- char-ci=? char-ci<? char-ci>? char-ci<=? char-ci>=? case-insensitive
- char-alphabetic? char-numeric? char-whitespace? char-upper-case? char-lower-case?
- string->list (returns chars) and list->string (accepts chars)
- #\a #\space #\newline reader syntax in spec/parser.sx
- integer->char alias in spec/evaluator.sx
- js-char-renames dict in transpiler.sx for ->-containing names
- 43 tests in spec/tests/test-chars.sx, all passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-01 11:50:04 +00:00
parent 46da676c29
commit 4b600f17e8
7 changed files with 788 additions and 297 deletions

View File

@@ -4776,3 +4776,5 @@
(define intern (fn (s) (make-symbol s)))
(define symbol-interned? (fn (sym) true))
(define integer->char make-char)