[m-dev.] proposal for promise_pure scope warning

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Apr 15 14:11:36 AEST 2008


On Tue, 15 Apr 2008, Peter Schachte wrote:

> Julien Fischer wrote:
>> I think you only want to emit a warning for promise_pure scopes around
>> impure goals that do not have any outputs and have determinism det or
>> cc_multi however.
>
> That's a lot clearer:  the promise really looks like it must be a lie.  The 
> warning could ask the user to plug in their polygraph equipment into the USB 
> port and prepare to answer a series of questions.  But the promise still 
> might be correct.  The code might destructively modify some data structure in 
> an equivalence-preserving way, eg caching the result of a computation.

The problem here is that (some) Mercury programmers have a tendency to
try to promise impurity away ASAP rather than thinking about where the
correct place to do so is.  I don't think adding any number of new
warning options is going to fix this.

Julien.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list