[m-rev.] for review: MC++ stdin/stdout initialization

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Oct 18 23:30:05 AEST 2002


Tyson, I found this XXX comment below to be somewhat mysterious:
why didn't you just write it in the obvious way in the first place?
Is there something I'm missing?

Estimated hours taken: 0.5
Branches: main

library/io.m:
	Fix an XXX in the MC++ code:
	make mercury_current_text_output be initialized to point to
	mercury_stdout, rather than re-opening the console stream.
	Likewise for the stdout and the binary versions of stdin/stdout.

Workspace: /c/fjh/ws/2/mercury
Index: library/io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.267
diff -u -d -r1.267 io.m
--- library/io.m	11 Oct 2002 00:56:54 -0000	1.267
+++ library/io.m	18 Oct 2002 13:29:12 -0000
@@ -3508,19 +3508,10 @@
 static MR_MercuryFile mercury_stdout_binary =
 	new_mercury_file(0, 1);
 
-	// XXX these should not create extra copies, instead we should
-	// use the mercury_files above.
-
-static MR_MercuryFile mercury_current_text_input =
-	new_open_mercury_file(System::Console::OpenStandardInput(),
-		System::Console::In, NULL, 1);
-static MR_MercuryFile mercury_current_text_output =
-	new_open_mercury_file(System::Console::OpenStandardOutput(),
-		NULL, System::Console::Out, 1);
-static MR_MercuryFile mercury_current_binary_input =
-        new_mercury_file(0, 1);
-static MR_MercuryFile mercury_current_binary_output =
-        new_mercury_file(0, 1);
+static MR_MercuryFile mercury_current_text_input = mercury_stdin;
+static MR_MercuryFile mercury_current_text_output = mercury_stdout;
+static MR_MercuryFile mercury_current_binary_input = mercury_stdin_binary;
+static MR_MercuryFile mercury_current_binary_output = mercury_stdout_binary;
 
 static System::IO::IOException *MR_io_exception;
 
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list