[m-rev.] for post-commit review: explicit streams 1

Zoltan Somogyi zoltan.somogyi at runbox.com
Thu Aug 19 19:10:12 AEST 2021


For review by anyone.

I do have a broader question for everyone on a topic
related to this diff. In october last year, I set up five streams
when output related to a module should go. Error output
was one of the five. However, we did not discuss exactly
what kinds of errors are covered. By far the most frequently
encountered errors are syntactic and semantic errors
in source files, for which we now generate error_specs,
and then print these error_specs to the module's error stream.
But there can also be errors when opening a file for
either reading or writing, and these are different, for at least
two reasons. First, if you want to print error messages about
semantic errors in e.g. module1.m to module1.err, you
cannot print an error message about being unable to open
module1.err for writing to module1.err :-) Second, even if
you could write error messages about file open/read/write
operations to a .err file, you probably wouldn't want to.
Writing them to stderr is more likely to get the user's attention,
and in this case, I think that is a good thing.

So I think we should establish a rule that failure to open, read
or (possibly) write to a file will result in the error message
being printed to stderr. Any objections?

Note that we would still need to think through the synchronization
of such messages with others that we also print to stderr.

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log.stream1
Type: application/octet-stream
Size: 318 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20210819/5717d601/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.stream1
Type: application/octet-stream
Size: 30122 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20210819/5717d601/attachment-0003.obj>


More information about the reviews mailing list