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

@@ -384,6 +384,11 @@
:returns "list"
:doc "Append x to end of coll (returns new list).")
(define-primitive "append!"
:params (coll x)
:returns "list"
:doc "Mutate coll by appending x in-place. Returns coll.")
(define-primitive "chunk-every"
:params (coll n)
:returns "list"
@@ -426,6 +431,11 @@
:returns "dict"
:doc "Return new dict with keys removed.")
(define-primitive "dict-set!"
:params (d key val)
:returns "any"
:doc "Mutate dict d by setting key to val in-place. Returns val.")
(define-primitive "into"
:params (target coll)
:returns "any"