[comp.lang.pascal] Simple question

ian@r6.uucp (Ian Cottam) (10/13/89)

[Users of the T-word should press n now!]

This is more to get an article out about real Pascal than desparate
need to know the answer.  However, recently I have been bitten by
different compilers (all `standard' though -- I don't mean T****)
interpretation of what reset/rewite on input/output means.  The ISO
standard leaves the interpretation open to each implementation (N.B.
it does not say it is an error as I have seen stated by some people).
Two questions. 1) Why not define their meaning? 2) If you have access to
an ISO Pascal compiler, I would be interested in their interpretation
your implementation gives.  You might try the program below.  You might
wait to see if anyone else has posted the behaviour of your favorite
compiler (I know what SUN Pascal does).
   __________________________________________________

program iotest(input, output);

 procedure p(var outp, inp: text);
  begin
	reset(inp);
	rewrite(outp);
	writeln(outp, inp^)
  end;

begin
 p(output, input);     { what happens in alias case? }
 { what happens in explicit case? }
 rewrite(output);
 reset(input); 
 writeln(input^)
end.

-----------------------------------------------------------------
Ian Cottam, Room IT101, Department of Computer Science,
University of Manchester, Oxford Road, Manchester, M13 9PL, U.K.
Tel: (+44) 61-275 6157         FAX: (+44) 61-275-6280
Internet: ian%cs.man.ac.uk@nss.cs.ucl.ac.uk   
JANET: ian@uk.ac.man.cs    UUCP: ..!mcvax!ukc!man.cs!ian
-----------------------------------------------------------------

-----------------------------------------------------------------
Ian Cottam, Room IT101, Department of Computer Science,
University of Manchester, Oxford Road, Manchester, M13 9PL, U.K.
Tel: (+44) 61-275 6157         FAX: (+44) 61-275-6280
Internet: ian%cs.man.ac.uk@nss.cs.ucl.ac.uk   
JANET: ian@uk.ac.man.cs    UUCP: ..!mcvax!ukc!man.cs!ian
-----------------------------------------------------------------