[m-rev.] for review: Define behaviour of string.to_char_list (and rev) on ill-formed sequences.

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Oct 21 17:01:42 AEDT 2019



On Mon, 21 Oct 2019 16:53:07 +1100, Peter Wang <novalazy at gmail.com> wrote:
> Having tried it, tainting the forward modes with `pragma obsolete'
> creates a lot of busy work to convert predicate calls to function calls,
> essentially for no gain. The reverse modes are hardly ever used in the
> Mercury system, and probably the same is true in other projects.
> 
> I think simply deleting the reverse modes (with a suitable deprecation
> period) will annoy fewer people.

The warning for calls to obsolete predicates is done by code in simplify_goal_call.m
that has access to the mode of the call. There is no reason why the obsolete pragma
can't be extended to allow the specification of a mode. At the moment, its first arg
must have the form predname/arity, but the compiler already has code to parse
terms of the form predname(modelist), which is used by e.g. pragma foreign_export.
We could extend obsolete pragmas to allow this form as well, and if used, we would
generate the obsolete warning only in the nominated mode.

If you want, I can implement this in a day or two.

Zoltan.


More information about the reviews mailing list