... and make {input,output}_stream synonyms for them, rather than vice versa.
library/io.m:
As above.
library/bitmap.m:
library/dir.m:
library/io.primitives_read.m:
library/io.stream_db.m:
library/io.text_read.m:
library/mercury_term_lexer.m:
library/stream.string_writer.m:
Conform to the change above.
tests/hard_coded/stream_string_writer_types.exp:
Expect the new type_ctor for text streams.
... by setting up their reader or writer fields then, instead of
testing at each input or output operation whether the relevant field is null,
and filling it in if it is.
library/io.primitives_read.m:
library/io.primitives_write.m:
Delete the test-and-fill-if-needed code from the read and write operations.
library/io.stream_ops.m:
Initialize the reader and writer fields of each MR_MercuryFileStruct
as it is created an file open time.
Document when each field of the MR_MercuryFileStruct is meaningful.
Add an XXX about binary vs text files.
Add an XXX proposing a new arrangement of stream types.
Also, move foreign code pieces still in io.m that belong in
previously-carved-out modules to those modules.
library/io.m:
library/io.stream_ops.m:
As above. The new private submodule contains the implementations
(helper predicates) of the operations that
- open and close streams,
- get and set offsets in those streams,
- get and set line numbers on streams,
- return the standard streams, and
- set streams as the current streams.
library/io.m:
Make some previously private includes public, to allow modules outside
of io.m to refer to the C# and Java symbols they define. These includes
are in the second, undocumented interface section of io.m.
Delete the foreign code moved to io.primitives_{read,write}.m,
as well as the foreign code moved to io.stream_ops.m.
Change {get,set}_{line_number,output_line_number}/3, which used
to be implemented directly using foreign_procs, to implement them
in terms of their arity-4 counterparts which take an explicit stream
argument, which now are in io.stream_ops.m. This can yield a slowdown,
but it should be so small as to be unmeasurable on all non-microbenchmark
workloads.
Move related code together.
Update module qualifications in C# and Java code.
Delete the second #include of mercury_library_types.h.
Delete the MR_{initial,final}_io_state macros.
library/MODULES_UNDOC:
library/library.m:
List the new submodule as undocumented.
library/io.primitives_read.m:
library/io.primitives_write.m:
Move the C, C# and Java code related to reading and writing values
of primitive types here from io.m. Put them into one foreign_decl
and one foreign_code per language.
Update module qualifications in C# and Java code.
library/benchmarking.m:
library/bitmap.m:
library/io.call_system.m:
Update module qualifications in C# and Java code.
library/stm_builtin.m:
Replace uses of the MR_{initial,final}_io_state macros with their bodies.
library/io.m:
library/io.primitives_read.m:
library/io.primitives_write.m:
As above. The two new private submodules contain the implementations
(helper predicates) of the operations that respectively read and write
values of primitive types.
library/MODULES_UNDOC:
library/library.m:
List the new submodules as undocumented.