Fix VM HO forms: for-each/map/filter resolve in SX-level VM

The SX-level VM couldn't find for-each/map/etc. because they're CEK
special forms, not primitives in the JS host. Added vm-resolve-ho-form
which creates wrapper functions that dispatch callbacks through
vm-call-external (handling VmClosure callbacks correctly).

Also fixed vm-call dispatch order: Lambda/Component checked before
generic callable? to avoid calling SX Lambdas as JS functions.

JS full: 1585/1585 (was 1582/3 failed). All 3 pre-existing failures fixed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-31 17:55:43 +00:00
parent 9dd27a328b
commit a2348e5281

1027
lib/vm.sx

File diff suppressed because it is too large Load Diff