[m-rev.] for review: don't allow nondefault mode functions in terms

Mark Brown mark at mercurylang.org
Fri Oct 30 17:24:30 AEDT 2015


On Fri, Oct 30, 2015 at 4:55 PM, Zoltan Somogyi
<zoltan.somogyi at runbox.com> wrote:
> On Fri, 30 Oct 2015 14:52:38 +1100, Mark Brown <mark at mercurylang.org> wrote:
>> On Fri, Oct 30, 2015 at 1:58 PM, Zoltan Somogyi
>> <zoltan.somogyi at runbox.com> wrote:
>> > The language reference manual already disallows putting functions with
>> > nondefault mode and determinism signatures into terms (in section 8.3)
>>
>> Did you mean to say *ground* terms? They are not generally disallowed in terms.
>
> I don't really understand your question. Do you mean "ground" as in
> "contains no variables" or "ground" as "Inst = ground(shared, none)",
> i.e. no further information about its binding. If the former, the presence of
> variables elsewhere in the term should not matter. If the latter, I don't know
> how that could affect the decision made by the newly added code.

The latter. I thought it would still be okay to construct and use a
term with a non-default mode, but it would be a mode error to pass it
anywhere expecting ground.

>
>> > We allowed it so far, and even used such code ourselves, even though
>> > it could lead to crashes. So this diff, which disallows such code, would
>> > de facto, though not de jure, change the language. Any objections to that?
>>
>> For the changes in the browser directory, is it not possible to always
>> keep the directory list in simplified form and accurately reflect that
>> in the inst? That would be preferable to dynamic checking.
>
> You are almost certainly right. I was just going for a minimum change
> with this diff, and intended to come back to it later, reflecting the simplified
> form of the dir list in the *type*. We don't want to put that info into insts
> as long as we want to put such functions into terms.

Okay.

Cheers,
Mark.



More information about the reviews mailing list