[#87] let bindings: special forms DO work — surface the errors the bench was swallowing #90
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Winnie/bankwars!90
Loading…
Reference in a new issue
No description provided.
Delete branch "87-let-if"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
#87 — "can't put if/cond in let binding". Root cause found, and it is not the interpreter's special forms.
The actual failure
Lane B's broken v2 construct (
8bfcf59) was aletwhose bindings list was missing one closer, so the intended body(if ...)parsed as a SECOND binding — a 3-element list. The interpreter correctly rejected it withmalformed let binding. The real bug: hook run-time errors print only when!headlessMode, so in every bench the dying hook was completely silent. That invisibility is what made a paren typo look like "the interpreter can't eval if inside let".if/cond/nestedletinside let bindings all evaluate fine — the production brains depend on the pattern (the super-v2 trunk prices its risk budget with(let ((mult (if ...))) ...)).The fix
ai.gocallHook: hook errors now ALWAYS print to stderr and append to the game log (headless or not). Benches keep clean stdout tables; the failure lands in the log/stderr where it can be grepped.let_binding_test.goregression tests: (1)if,cond, nestedlet, andif-as-argument inside let bindings evaluate to the right values; (2) the exact malformed shape from #87 is rejected withmalformed let binding; (3) a hook erroring at run time leaves a trace in the game log underheadlessMode.Gate: full
go testgreen,go vetgreen, spectate smokes 0 ai-errors / 0 divergences. Branch 87-let-if @689911a.