[m-rev.] for post-commit review: uints in edit_seq.m

Julien Fischer jfischer at opturion.com
Thu Jan 1 17:58:09 AEDT 2026


Hi Zoltan,

Happy new year!

On Thu, 1 Jan 2026 at 17:22, Zoltan Somogyi <zoltan.somogyi at runbox.com> wrote:
>
> The concept has been agreed and the diff itself is straightforward.
> The only part worth reviewing in the entry in NEWS.md. I would also
> like to know if anyone objects to adding list.ulength, a version of
> list.length that returns a uint, or if anyone has a better name for it.

No objections from me, I have thought about adding myself in the past.
If we are going to go down this road, then map.count, set.count etc should
also have versions returning uints (e.g. ucount).

> Enforce an invariant using types.

...

> diff --git a/NEWS.md b/NEWS.md
> index b5e019c85..9770cf4e2 100644
> --- a/NEWS.md
> +++ b/NEWS.md
> @@ -257,6 +257,13 @@ Changes to the Mercury standard library
>    is closest to the query sequence, in terms of the configurable `distances`
>    added by operations such as inserting or replacing elements in sequences.
>
> +### Changes to the `edit_seq` module
> +
> +* This module deals with many integers, including row numbers, column numbers,
> +  and operation costs) that cannot be negative. To ensure that this restriction

That parenthesis shouldn't be there.

> +  is enforced automatically, we have changed the types of all these integers
> +  from `int` to `uint`.

That looks fine otherwise.

Julien.


More information about the reviews mailing list