[m-rev.] for review: start using type_spec_constrained_preds pragmas

Julien Fischer jfischer at opturion.com
Fri Feb 9 23:45:46 AEDT 2024


On Fri, 9 Feb 2024, Zoltan Somogyi wrote:

> On 2024-02-09 18:40 +11:00 AEDT, "Julien Fischer" <jfischer at opturion.com> wrote:
>> What prompted my question was looking into why the instance definition
>> for unboxed_reader(text_input_stream, char, io, io.error) isn't being
>> put into io.opt. The answer is that we do not write out instance
>> definitions that contain clauses into .opt files -- see the XXX in
>> compiler/intermod_decide.m.
>
> I never liked the idea of defining methods by clauses instead of naming
> a predicate: having a name on the implementation of a method for an instance
> can be useful.
>
> The right short-term fix here is to replace the method clause with
> the name of a predicate that has that clause.

I will go ahead and do that.

(The use of clauses in instances in the io module is due to having to
convert between io types (e.g. result, res, whence) and their 
counterparts in the stream module (which are what the methods of the
stream type classes expect). Ideally, we would just have one set of
these types, but that's probably a bit too large of a breaking change ...)

>>> The module comment of intermod.m should be modified to point
>>> to prog_item.m. Do you want to do it, or should I?
>>
>> Feel free to update it.
>
> Attached, for your post-commit review.

That looks fine.

Julien.


More information about the reviews mailing list