[m-dev.] comments on binary input streams and bytes as ints
Julien Fischer
jfischer at opturion.com
Tue Mar 8 21:41:56 AEDT 2022
Hi Zoltan,
Commit 5951724 adds the following XXX comments.
Here are my comments about those comments.
+:- instance stream.reader(binary_input_stream, int, io,
io.error).
+:- instance stream.reader(binary_input_stream, int8, io,
io.error).
+:- instance stream.reader(binary_input_stream, uint8, io,
io.error).
+% XXX IO_INSTANCE reader for int calls read_byte
The use of int here is a legacy usage in the standard library.
Historically, it has represented a "byte" using the lower 8 bits on int.
Now that we have proper 8 bit sized types, the "byte is the lower 8 bits
of an int" approach should be deprecated. (I think I have already added
uint8/int8 alternatives for all the affected operations.)
+% XXX IO_INSTANCE inconsistent: no instance for uint
No such instance should be added.
+:- instance stream.unboxed_reader(binary_input_stream, int8, io,
io.error).
+:- instance stream.unboxed_reader(binary_input_stream, uint8, io,
io.error).
+% XXX IO_INSTANCE no instance for int
unboxed_readers were added *after* fixed size integers; I didn't think
there is any point adding an int version only to eventually remove it.
+:- instance stream.putback(binary_input_stream, int, io,
io.error).
+:- instance stream.putback(binary_input_stream, int8, io,
io.error).
+:- instance stream.putback(binary_input_stream, uint8, io,
io.error).
+% XXX IO_INSTANCE putback for int calls putback_byte
+% XXX IO_INSTANCE inconsistent: no instance for uint
As above.
Julien.
More information about the developers
mailing list