[m-rev.] for review: MC++ stdin/stdout initialization
Tyson Dowd
trd at cs.mu.OZ.AU
Sat Oct 19 12:53:17 AEST 2002
Possibly because it might not work as expected.
At the time the MC++ compiler was pretty buggy and my policy was not to
change code while it was impossible to test. Much of the time after an
update IO didn't work at all, so making innocent looking changes while
trying to get it to work was impossible to test.
Or maybe I was just extremely lazy. One of the two.
On 18-Oct-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 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
> --------------------------------------------------------------------------
--
Tyson Dowd #
# Surreal humour isn't everyone's cup of fur.
trd at cs.mu.oz.au #
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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