[m-rev.] for review: add "did you mean" reminders for mistyped predicate names

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Sep 25 04:27:13 AEST 2023


We discussed this on m-users a few days ago.

For review by anyone. I am particularly looking for feedback
on whether any part of the change to edit_seq.m should stay.
I originally intended to base the new error message functionality
on new code in edit_seq.m, but this turned out to be significantly
harder than writing new code, in a new module (edit_distance.m)
using the gcc code Julien linked to as the basis.

I can see three options:

- Keeping edit_seq.m as it was.

- Keeping only the addition of the new predicate for finding the
  closest candidate sequence, but undoing the generalization
  of the edit_params type.

- Keeping both the changes to edit_seq.m in the attached diff:
  the new predicate, *and* the generalization.

Note that the generalization requires changes in modules
that use this existing module if they pass parameters around,
so it is a breaking change, and the breakage does not buy you
anything helpful if your use case is the existing use case for
this module, i.e. the generation of diffs. This is why I would
prefer one of the first two options.

WIth either of the last two options, I would of course document
the chosen option in NEWS.md, and with any of the options,
I would add a note to edit_seq.m about the existence of
edit_distance.m. (The form of the note would depend on
the chosen option, which is why I haven't written it yet.)
The fate of the new test cases for edit_seq.m also depends on this
decision.

There is also a new XXX in typecheck_error_undef.m
I would like your opinions on: should we print "did you mean"
hints in the presence of hints about pred vs func and/or
missing module qualification?

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log.dym
Type: application/octet-stream
Size: 2287 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20230925/72d941b3/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.dym
Type: application/octet-stream
Size: 81558 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20230925/72d941b3/attachment-0003.obj>


More information about the reviews mailing list