Replace invoke with cek-call in adapters and engine

Completes the invoke→cek-call migration across all spec .sx files:
- adapter-sx.sx: map/filter/for-each in aser wire format
- adapter-dom.sx: island render update-fn
- engine.sx: fetch transform callback
- test-cek-reactive.sx: disposal test

Only async-invoke (adapter-async.sx) remains — separate async pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-14 10:16:47 +00:00
parent 455e48df07
commit 6581211a10
6 changed files with 15 additions and 15 deletions

View File

@@ -14,7 +14,7 @@
// =========================================================================
var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } });
var SX_VERSION = "2026-03-14T10:06:04Z";
var SX_VERSION = "2026-03-14T10:16:03Z";
function isNil(x) { return x === NIL || x === null || x === undefined; }
function isSxTruthy(x) { return x !== false && !isNil(x); }
@@ -1868,7 +1868,7 @@ return result; }, args);
var local = envMerge(lambdaClosure(f), env);
envSet(local, first(lambdaParams(f)), item);
return aser(lambdaBody(f), local);
})() : invoke(f, item)); }, coll);
})() : cekCall(f, [item])); }, coll);
})() : (isSxTruthy((name == "map-indexed")) ? (function() {
var f = trampoline(evalExpr(first(args), env));
var coll = trampoline(evalExpr(nth(args, 1), env));
@@ -1877,7 +1877,7 @@ return result; }, args);
envSet(local, first(lambdaParams(f)), i);
envSet(local, nth(lambdaParams(f), 1), item);
return aser(lambdaBody(f), local);
})() : invoke(f, i, item)); }, coll);
})() : cekCall(f, [i, item])); }, coll);
})() : (isSxTruthy((name == "for-each")) ? (function() {
var f = trampoline(evalExpr(first(args), env));
var coll = trampoline(evalExpr(nth(args, 1), env));
@@ -1886,7 +1886,7 @@ return result; }, args);
var local = envMerge(lambdaClosure(f), env);
envSet(local, first(lambdaParams(f)), item);
return append_b(results, aser(lambdaBody(f), local));
})() : invoke(f, item)); } }
})() : cekCall(f, [item])); } }
return (isSxTruthy(isEmpty(results)) ? NIL : results);
})() : (isSxTruthy((name == "defisland")) ? (trampoline(evalExpr(expr, env)), serialize(expr)) : (isSxTruthy(sxOr((name == "define"), (name == "defcomp"), (name == "defmacro"), (name == "defstyle"), (name == "defhandler"), (name == "defpage"), (name == "defquery"), (name == "defaction"), (name == "defrelation"), (name == "deftype"), (name == "defeffect"))) ? (trampoline(evalExpr(expr, env)), NIL) : (isSxTruthy((name == "scope")) ? (function() {
var scopeName = trampoline(evalExpr(first(args), env));
@@ -2485,7 +2485,7 @@ return (isSxTruthy(testFn()) ? (function() {
})();
return (function() {
var initial = cekRun(makeCekState(expr, env, [makeReactiveResetFrame(env, updateFn, true)]));
return invoke(updateFn, initial);
return cekCall(updateFn, [initial]);
})();
})(); };
@@ -2747,7 +2747,7 @@ return (function() {
return (isSxTruthy((isSxTruthy(env) && isSxTruthy(newHtml) && !isSxTruthy(isEmpty(newHtml)))) ? (function() {
var parsed = parse(newHtml);
return (function() {
var sxContent = (isSxTruthy(transform) ? invoke(transform, parsed) : parsed);
var sxContent = (isSxTruthy(transform) ? cekCall(transform, [parsed]) : parsed);
disposeMarshScope(oldMarsh);
return withMarshScope(oldMarsh, function() { return (function() {
var newDom = renderToDom(sxContent, env, NIL);