[m-dev.] For review: minor additions to list.m and string.m
Zoltan Somogyi
zs at cs.mu.OZ.AU
Fri Sep 8 19:43:02 AEDT 2000
On 08-Sep-2000, Ralph Becket <rbeck at microsoft.com> wrote:
> By the way, a while back I suggested that, just as a function without
> a mode declaration is assigned a `func(in, in, ..., in) = out is det'
> mode by default, a predicate without a mode declaration should have a
> default mode of `pred(in, in, ..., in) is semidet'. But I don't think
> I got a response.
With functions, the mode you want is the "func(in, ..., in) = out is det"
mode 99% of the time. With predicates, it is relatively rare that the mode
you want is "pred(in, in, ..., in) is semidet". Only about 15% of the
predicates in the Mercury compiler are semidet, and many of those, maybe
most, have output arguments. So this default would have a much higher chance
of getting rid of an error message the programmer should get but doesn't
know he/she wants. I would estimate that these missing error messages would
reduce productivity by a larger amount than the absence of a requirement
to write down the mode would increase it.
Zoltan.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list