From 835b5314ce7206280edf92a24eeecadbc8adc3e7 Mon Sep 17 00:00:00 2001 From: giles Date: Fri, 1 May 2026 08:04:08 +0000 Subject: [PATCH] =?UTF-8?q?plan:=20tick=20Phase=208=20complete=20=E2=80=94?= =?UTF-8?q?=20multiple=20values=20done?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- plans/agent-briefings/primitives-loop.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plans/agent-briefings/primitives-loop.md b/plans/agent-briefings/primitives-loop.md index 6c028214..5b8037b2 100644 --- a/plans/agent-briefings/primitives-loop.md +++ b/plans/agent-briefings/primitives-loop.md @@ -241,13 +241,13 @@ Primitives / forms to add: - `define-values` `(a b ...)` `expr` — top-level multi-value bind Steps: -- [ ] Spec: add `SxValues` type to evaluator; implement `values` + `call-with-values` in +- [x] Spec: add `SxValues` type to evaluator; implement `values` + `call-with-values` in `spec/evaluator.sx`; add `let-values` / `define-values` special forms. -- [ ] OCaml: add `SxValues of value list` to `sx_types.ml`; wire through CEK. -- [ ] JS bootstrapper: implement values type + forms. -- [ ] Tests: 25+ tests in `spec/tests/test-values.sx` — basic producer/consumer, let-values +- [x] OCaml: add `SxValues of value list` to `sx_types.ml`; wire through CEK. +- [x] JS bootstrapper: implement values type + forms. +- [x] Tests: 25+ tests in `spec/tests/test-values.sx` — basic producer/consumer, let-values destructuring, define-values, interaction with `begin`/`do`. -- [ ] Commit: `spec: multiple values (values/call-with-values/let-values)` +- [x] Commit: `spec: multiple values (values/call-with-values/let-values)` --- @@ -712,6 +712,7 @@ _Newest first._ - 2026-04-26: Phase 4 JS step done — all CEK primitives already in sx-browser.js; fix was pre-loading spec/coroutines.sx+spec/signals.sx in run_tests.js so (import (sx coroutines)) resolves synchronously. 17/17 coroutine tests pass JS. 1965/2500 total (+25), zero new failures. - 2026-04-26: Phase 4 OCaml step done — no native SxCoroutine type needed; existing cek-step-loop/cek-resume/perform/make-cek-state primitives in run_tests.ml fully support the spec/coroutines.sx library. 284/284 pass (coroutines+vectors+numeric-tower+dynamic-wind), zero regressions. - 2026-04-26: Phase 4 Spec step done — spec/coroutines.sx define-library with make-coroutine/coroutine-resume/coroutine-yield/coroutine?/coroutine-alive?; make-coroutine stub in evaluator.sx; 17/17 coroutine tests pass (OCaml). Key insight: coroutine body must use (define loop (fn...)) + (loop 0) not named let — named let uses cek_call→cek_run which errors on IO suspension. +- 2026-05-01: Phase 8 complete — values/call-with-values/let-values/define-values. Dict marker {:_values true :_list [...]} (no new type). step-sf-define desugars shorthand (define (f x) body) on both hosts. 25/25 tests OCaml+JS. Committed 43cc1d90. - 2026-04-26: Phase 3 complete — OCaml+JS done. CallccContinuation gains winders-depth int; make_callcc_continuation/callcc_continuation_winders_len wired; wind-after/wind-return CekFrame fields fixed (cf_f=after-thunk, cf_extra=winders-len, cf_name=body-result); get_val + transpiler.sx updated. 8/8 dynamic-wind tests pass on OCaml; 235/235 (callcc+guard+do+r7rs) zero regressions. Committed 6602ec8c. - 2026-04-26: Phase 3 Spec+Tests done — dynamic-wind CEK implementation: wind-after/wind-return frames, *winders* stack, kont-unwind-to-handler, wind-escape-to. callcc frame stores winders-len in continuation; callcc-continuation? calls wind-escape-to before escape. 8/8 dynamic-wind tests pass (normal return, raise, call/cc, nested LIFO, guard ordering). 1948/2500 JS (+8). Zero regressions. Committed a9d5a108. - 2026-04-26: Phase 2 complete — Verify+Commit done. OCaml 4874/394, JS 1940/2500 (+60). No regressions. 6 JS-only failures are float≡int platform-inherent. Phase 2 fully landed across 4 commits.