HS: append command, list stringify as comma-separated

Compiler:
- append to symbol → (set! target (hs-append target value))
- append to DOM → (hs-append! value target)

Runtime:
- hs-append: pure function for string concat and list append
- hs-append!: DOM insertAdjacentHTML for element targets

Mock DOM:
- dom_stringify handles List by joining elements with commas
  (matching JS Array.toString() behavior)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-20 19:40:27 +00:00
parent c25ab23709
commit c8aab54d52
3 changed files with 40 additions and 23 deletions

View File

@@ -1143,10 +1143,13 @@
((= head (quote go))
(list (quote hs-navigate!) (hs-to-sx (nth ast 1))))
((= head (quote append!))
(list
(quote dom-append)
(hs-to-sx (nth ast 2))
(hs-to-sx (nth ast 1))))
(let
((tgt (hs-to-sx (nth ast 2)))
(val (hs-to-sx (nth ast 1))))
(if
(symbol? tgt)
(list (quote set!) tgt (list (quote hs-append) tgt val))
(list (quote hs-append!) val tgt))))
((= head (quote tell))
(let
((tgt (hs-to-sx (nth ast 1))))