[m-dev.] proposal for promise_pure scope warning

Ian MacLarty maclarty at csse.unimelb.edu.au
Mon Apr 14 14:35:54 AEST 2008


On Mon, Apr 14, 2008 at 01:59:16PM +1000, Jakob Puchinger wrote:
> Hi,
> 
> >  What do people think about emitting a warning when a promise_pure scope
> >  contains only one goal?
> >
> >  Are there any cases where one would want to use a promise_pure scope on
> >  a single impure goal instead of moving the promise down into the called
> >  predicate?
> 
> I don't know if this is such a good idea, if you do not own the code
> of the called predicate
> you might not be able to do so.
> 

Well, either the author of the called predicate made it impure for a
reason, in which case you shouldn't be promising that a call to the
predicate is pure, or the author made a mistake and the predicate is
actually pure, in which case it is the author's responsibility to
fix the interface.  In any case the warning can always be disabled.

Ian.
--------------------------------------------------------------------------
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