[m-dev.] question about exception.m and also mode-specific clauses

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Aug 17 05:14:46 AEST 2001


On 17-Aug-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> Why is the determinism of get_determinism "cc_multi" instead of "det"?

Determinism is an operational concept.  In the declarative semantics for
Mercury, closures don't have a determinism attached to them.
If you want to get the determinism of a closure, you're adding
additional information that is not present in the declarative semantics,
so it has to be cc_multi.

> And if you write mode-specific clauses for code, should the compiler
> just believe the determinism you give, and not try to suggest a more accurate
> determinism?

No.  The warning in this case is probably not spurious.

If you have a `promise_pure' declaration, the declarative semantics for all the
the different modes needs to be the same.  I'll bet in your code the semantics
is actually different.

One way to solve this is by writing each mode-specific clause so that
it contains a disjunction, with the only difference between the clauses
for different modes being that the disjuncts are in a different order.

You'd need to compile with --no-reorder-disj to ensure that you get the
intended operational semantics.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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