There is confusion between inport and loadport.
The read-char, read... functions try to read from the currently loaded file rather than standard input.
I'm rejecting the first part of the patch which modifies opdefines.h as it would allow up to 2 arguments for open-input-file but the R5RS only shows 1 argument as valid. I need to take a closer look at the changes for the scheme.c file.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Seemingly is duplicated by https://sourceforge.net/p/tinyscheme/patches/26/ but in current version just removing two lines (as suggested there) looks enough (works correctly in both interpreted and script mode).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
workaround to give an input port on stdin
I'm rejecting the first part of the patch which modifies opdefines.h as it would allow up to 2 arguments for open-input-file but the R5RS only shows 1 argument as valid. I need to take a closer look at the changes for the scheme.c file.
Patch is not meant to be applied. Just a workaround that worked for me.
I have not sufficient skills to produce a better patch.
Last edit: Kevin Cozens 2013-03-25
I think I have found a fix for this issue. I have attached a patch.
Here's a simple test case. inport_test.readme explains how it works.
Seemingly is duplicated by https://sourceforge.net/p/tinyscheme/patches/26/ but in current version just removing two lines (as suggested there) looks enough (works correctly in both interpreted and script mode).