Separate eval from render: render-active? gate in eval-list

eval-list only dispatches to the render adapter when render-active? is true.
render-to-html and aser set render-active! on entry. Pure evaluate() calls
no longer stringify component results through the render adapter.

Fixes component children parity: (defcomp ~wrap (&key &rest children) children)
now returns [1,2,3] in eval mode, renders to "123" only in render mode.

Parity: 112/116 pass (remaining 4 are hand-written evaluator.py bugs).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 03:42:04 +00:00
parent 0a7a9aa5ae
commit f54ebf26f8
5 changed files with 56 additions and 13 deletions

View File

@@ -174,8 +174,8 @@
(let ((mac (env-get env name)))
(make-thunk (expand-macro mac args env) env))
;; Render expression — delegate to active adapter.
(is-render-expr? expr)
;; Render expression — delegate to active adapter (only when rendering).
(and (render-active?) (is-render-expr? expr))
(render-expr expr env)
;; Fall through to function call