Deferred from #82: evaluated procedure values print as an empty string instead of a procedure representation.
Original feedback by @chatgpt-codex-connector on PR #82 (#82):
Print case-lambda closures
When a case-lambda value is returned instead of immediately applied, such as (linklet () () (case-lambda ((x) x))), interpretation produces a CaseLambdaClosure and main prints it through ValueNode::write(). This override is empty, so the program emits only the trailing newline instead of the procedure representation provided by CaseLambda::write(), making procedure-valued results disappear.
Context: In src/ASTRuntime.cpp, both CaseLambdaClosure::write() (line 84) and Closure::write() (line 45) are empty, whereas the AST nodes CaseLambda::write() / Lambda::write() (src/AST.cpp) print #<procedure>. src/main.cpp:76 prints the top-level result via Result->write() — and an evaluated procedure is always a closure value, so its (empty) writer runs. Consequently a bare top-level lambda or case-lambda prints only a newline.
Why deferred: scope-creep — the empty CaseLambdaClosure::write() is exact parity with the pre-existing Closure::write(), so PR #82 introduces no case-lambda-specific regression. The correct fix gives both Closure and CaseLambdaClosure a #<procedure> representation together; changing only the case-lambda writer would create a new inconsistency between the two procedure kinds, and the shared fix touches pre-existing lambda printing, which is outside the scope of an issue titled "Interpret case-lambda".
Filed automatically by pm-autofix-pr after dual-evaluator triage by Claude Opus 4.8 and Codex.
Deferred from #82: evaluated procedure values print as an empty string instead of a procedure representation.
Original feedback by @chatgpt-codex-connector on PR #82 (#82):
Context: In
src/ASTRuntime.cpp, bothCaseLambdaClosure::write()(line 84) andClosure::write()(line 45) are empty, whereas the AST nodesCaseLambda::write()/Lambda::write()(src/AST.cpp) print#<procedure>.src/main.cpp:76prints the top-level result viaResult->write()— and an evaluated procedure is always a closure value, so its (empty) writer runs. Consequently a bare top-levellambdaorcase-lambdaprints only a newline.Why deferred: scope-creep — the empty
CaseLambdaClosure::write()is exact parity with the pre-existingClosure::write(), so PR #82 introduces no case-lambda-specific regression. The correct fix gives bothClosureandCaseLambdaClosurea#<procedure>representation together; changing only the case-lambda writer would create a new inconsistency between the two procedure kinds, and the shared fix touches pre-existinglambdaprinting, which is outside the scope of an issue titled "Interpret case-lambda".Filed automatically by
pm-autofix-prafter dual-evaluator triage by Claude Opus 4.8 and Codex.