FFI: define-foreign special form in evaluator — registry, param parser, kwargs parser, binding resolver, type checker, lambda builder, dispatcher. Generates callable lambdas that route through foreign-dispatch to host-call. 24 tests in test-foreign.sx (registry, parsing, resolution, type checking). Transpiler: fix mutable global ref emission — ml-emit-define now emits both X_ref = ref <init> and X_ = <init> for starred globals (was missing the ref definition entirely, broke retranspilation). Add *provide-batch-depth*, *provide-batch-queue*, *provide-subscribers* to mutable globals list. Evaluator: add missing (define *provide-batch-queue* (list)) and (define *provide-subscribers* (dict)) — were only in hand-edited sx_ref.ml. Known: 36 bind-tracking + 8 capability test failures on retranspilation (pre-existing transpiler local-ref shadowing bug, not caused by FFI). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6.1 KiB
6.1 KiB