[m-rev.] for review: read Mercury files using read_file_as_string

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Jul 29 18:40:02 AEST 2019



On Sun, 28 Jul 2019 11:35:07 +1000, Peter Wang <novalazy at gmail.com> wrote:
> > IIRC, that test was not added because of any specfic issue with the
> > compiler but as part of change by Simon to prevent null chars being used
> > in Mercury generally.
> 
> I think it's fine just to comment out the lines containing NUL bytes.

That would be equivalent to deleting the test, since detecting NUL bytes
is its only job.

> > I suggest you add the C implementation and a fallbck Mercury implementation
> > (as we have with read_file_as_string).  I can add the Java version.
> > My Erlang is probably not up to the task of adding it for that language :-(

Attached is the proposed diff, for review by Peter (the Erlang part) and Julien
(everything else).

> There should be no need for specific versions for the non-C backends,
> as the string representation in those backends include the length in
> code units.

That would require a significant change in approach compared to the one
used to implement read_file_as_string. My diff aims to make the smallest
change possible.

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log.cu
Type: application/octet-stream
Size: 167 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20190729/3885811f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.cu
Type: application/octet-stream
Size: 10238 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20190729/3885811f/attachment-0001.obj>


More information about the reviews mailing list