#298 REPL piped stdin reads ALL forms before evaluating the first — defpackage + qualified use in one buffer misbinds

closed
Opened by atgreen

Found while closing cave#297 (which it caused). ag-repl-iter reads the entire piped stdin buffer and READS every form before EVALUATING the first, so any script of the shape (defpackage :p …) (p::sym …) — or (load something-that-defines-P) followed by p::sym — piped in one buffer interns p::sym BEFORE P exists: find-package misses and ag-reader-intern-qualified-nonkw falls back to a bare-name mint (wrong identity, no error). ag-load-source-interleaved already solves this for (load file) — the piped-REPL path should interleave read/eval per form the same way (cave#266-prereq comment at repl.lisp:658 documents the pattern). Bites real scripts, not just tests: printf '(defpackage :x …)(x::f)' | funcl misbinds today.

Comments (1)

atgreen3992925683

Fixed (commit above): ag-repl-iter now routes the balanced stdin buffer through ag-load-source-interleaved — read-one-eval-one with the same per-form handler/report and dispatch as before; ag-repl-finish-read still handles multi-line continuation. Repro prints 5; REPL bootstrap tests 4/4; full fasl battery green.