R5RS specifically says that `load` does not affect the values returned `current-input-port` and `current-output-port`. https://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_sec_6.6.4 This bug is causing tinyscheme to fail every one of these benchmarks: https://github.com/ecraven/r7rs-benchmarks/blob/master/results.TinyScheme Before: % echo 1234 | ./scheme -c '(begin (display (read)) (newline))' ==> #<EOF> % echo 1234 | ./scheme <( echo '(begin (display (read)) (newline))' ) ==> #<EOF> After: % echo 1234 | ./scheme <( echo '(begin (display (read)) (newline))' ) ==> 1234 % echo 1234 | ./scheme -c '(begin (display (read)) (newline))' ==> 1234
This seems to be severe! It prevents
./scheme
reading from console when program is run from file. Would be good to merge the suggested patch unless it breaks anything :)E.g. if we create the file
test.scm
:and try running it with
./scheme test.scm
, it won't stop to wait for user input, instead printing literallyEnter something:(newline)
.