Waldek Hebisch wrote:
... snip ...
So, IMHO the following program is correct (and works with the patch):
program fjf490b(Output);
var t: Text; c: Char;
begin Rewrite (t); Reset (t);
I disagree. At this point t is open, and using lazy i/o a get is pending.
c := t^;
To implement this the system should perform the actual get. The get fails, because the file is at EOF, signalling "attempt to read past EOF". It has nothing to do with the definedness of t^. Similarly eoln(t) should fail.
writeln('OK')
So this should be "writeln('Failed');
end.
Accessing f^, or executing eoln or any read on t, should call something that checks whether a get is pending, and executes it if so. This is a library issue. The compiler issure is to make sure that the f^ action calls the routine, which should return the pointer. You cannot have lazy i/o and just access the file pointer as another address.