[m-rev.] for review: add unboxed_readers to the stream module
novalazy at gmail.com
Mon Apr 20 10:55:10 AEST 2020
On Sun, 19 Apr 2020 14:19:23 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote:
> > It should say something about the return value in case of eof or error,
> > i.e. no particular value is guaranteed. io.read_char_unboxed also lacks
> > that documentation, oops.
> Ok, I've added the following to it:
> % Get the next unit from the given stream. On error or eof an
> % arbitrary value of type Unit is returned.
> I don't think the type class interface can, or should, make stronger
> guarantees than that; obviously for read_char_unboxed we can document
> that it returns 0.
> > I prefer the name io.read_char_unboxed over io.unboxed_read_char as it
> > is a minor variation on io.read_char, and keeps the important part (the
> > operation) up front. Therefore, I suggest to name the new method
> > get_unboxed, but it's only a slight suggestion.
> We already have type class named bulk_reader which has the method
> bulk_get, so for the sake of consistency (at least amongst the
> stream type classes themselves), I'd prefer to keep the names
> as I had them.
More information about the reviews