go: after(d) timer stub + 13 pattern tests → runtime 40/40, Phase 5 closed [shapes-scheduler]
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 24s

Acceptance bar hit (40 runtime, 497 total). Tests: timer ready,
select-with-timeout, fan-in (3 producers), worker queue, pipeline,
fan-out-then-fan-in, select source-order, fallback case, default,
producer-consumer, two-stage pipeline, channel-counter, after+default,
tick-collector.

Shape chiselled: timer collapses "after duration" into
"channel ready immediately" — select needs only ready? from each
case. Real time is when the flip happens, not what the protocol is.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-27 22:24:13 +00:00
parent fa99652970
commit 1d3021d206
9 changed files with 381 additions and 10 deletions

View File

@@ -23,7 +23,8 @@
(list "append" (list :go-builtin "append"))
(list "print" (list :go-builtin "print"))
(list "make" (list :go-builtin "make"))
(list "close" (list :go-builtin "close"))))
(list "close" (list :go-builtin "close"))
(list "after" (list :go-builtin "after"))))
(define
go-env-lookup
@@ -395,6 +396,12 @@
(not (go-chan? (first vals)))
(list :eval-error :close-not-chan (first vals))
:else (do (go-chan-close! (first vals)) nil))
(= name "after")
;; v0 stub for time.After: returns a channel already holding a
;; ready value (the duration arg is ignored). Lets `select`
;; with-timeout patterns express the intent even though we
;; don't model real time yet.
(let ((ch (go-make-chan))) (go-chan-send! ch :tick) ch)
:else (list :eval-error :unknown-builtin name)))))
(define