go: eval.sx — stmts + function application; recursive fib evaluates + 8 tests [nothing]
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 28s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 28s
Phase 4 cont. go-eval-stmt dispatches on: :return → wraps value in (:return-value V) sentinel :var-decl → bind each NAME via go-eval-var-decl :short-decl → bind each (:var NAME) lhs to corresponding expr value :assign → immutable-env shadowing (true mutation deferred) :block → run stmts via go-eval-block, propagating :return-value :if / :else → cond-driven dispatch :func-decl → bind name to (list :go-fn PARAMS BODY) else → expression statement, evaluate for side effects go-eval-call extends the CALLER's env with param-names → arg-values (dynamic-scope-ish — closures don't capture lexical env yet), runs the body block, catches :return-value and unwraps. **Recursive fib(5) = 5 evaluates correctly.** Recursion works because top-level func bindings are in the calling env before the recursive call happens. True lexical closures (let bind sees outer var; assignments visible to nested funcs) need an env-cell model with mutation; deferred to a later slice. eval 33/33, total 410/410. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"language": "go",
|
||||
"total_pass": 402,
|
||||
"total": 402,
|
||||
"total_pass": 410,
|
||||
"total": 410,
|
||||
"suites": [
|
||||
{"name":"lex","pass":129,"total":129,"status":"ok"},
|
||||
{"name":"parse","pass":176,"total":176,"status":"ok"},
|
||||
{"name":"types","pass":72,"total":72,"status":"ok"},
|
||||
{"name":"eval","pass":25,"total":25,"status":"ok"},
|
||||
{"name":"eval","pass":33,"total":33,"status":"ok"},
|
||||
{"name":"runtime","pass":0,"total":0,"status":"pending"},
|
||||
{"name":"stdlib","pass":0,"total":0,"status":"pending"},
|
||||
{"name":"e2e","pass":0,"total":0,"status":"pending"}
|
||||
|
||||
Reference in New Issue
Block a user