[m-rev.] for review: string.builder.append

Zoltan Somogyi zoltan.somogyi at runbox.com
Thu Feb 15 17:09:01 AEDT 2024


For review by anyone. Since I intend to work on this later today,
I would appreciate either a quick review, or an instant review/approval
of the concept and a promise of a post-commit review.

In a separate diff, I intend to move the code affected by this diff
in get_dependencies.m to format_call.m, for easier future maintenance.

The motivation for this diff is that I want to arrange for .*opt files
to be compared to their earlier versions the same way we now do this
for .intN files: by reading in the old file as a string, and comparing it
to the string form of the new version. This obviously requires the string
form of the new version, but currently we can't construct that, because

- a significant part of .opt files consists of clauses,
- intermod.m uses write_clause to write those clauses,
- write_clause has no clause_to_string version.

I could generalize write_clause by using the string.writer interface
to *either* build up a string *or* do I/O directly, but after the change above,
I don't think we will ever need the latter, because all our use cases,
both in normal operation and when debugging the compiler,
will prefer the former.

I therefore intend to change hlds_out_*.m, almost all of which now
just does I/O, to use string.builders everywhere, and to do so directly,
without going through the string.writer interface.

Are there any objections?

Zoltan.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log.sbf
Type: application/octet-stream
Size: 1396 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20240215/49933212/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.sbf
Type: application/octet-stream
Size: 23951 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20240215/49933212/attachment-0003.obj>


More information about the reviews mailing list