Register append! and dict-set! as proper primitives

Previously these mutating operations were internal helpers in the JS
bootstrapper but not declared in primitives.sx or registered in the
Python evaluator. Now properly specced and available in both hosts.

Removes mock injections from cache tests — they use real primitives.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 00:21:17 +00:00
parent 60b58fdff7
commit 6772f1141f
5 changed files with 29 additions and 13 deletions

View File

@@ -305,16 +305,6 @@ class TestDataCache:
self._time = current_time_ms
env["now-ms"] = lambda: self._time
# Mutating primitives needed by cache (available in JS, not bare Python)
def _dict_set(d, k, v):
d[k] = v
return v
def _append_b(lst, item):
lst.append(item)
return lst
env["dict-set!"] = _dict_set
env["append!"] = _append_b
# Define the cache functions from orchestration.sx
cache_src = """
(define _page-data-cache (dict))