[m-rev.] for review: will_not_throw_exception foreign proc attribute

Julien Fischer juliensf at cs.mu.OZ.AU
Sun Dec 5 19:49:45 AEDT 2004


On Fri, 3 Dec 2004, Zoltan Somogyi wrote:

> On 03-Dec-2004, Julien Fischer <juliensf at cs.mu.OZ.AU> wrote:
>
> > +:- type may_throw_exception
> > +	--->	will_not_throw_exception
> > +			% The foreign code makes calls back to Mercury
> > +			% but none of them will result in an exception
> > +			% being thrown.
>
> Why is the first part of the comment relevant? Users of this attribute
> should use it only to test for exceptions, not for calls to Mercury.
>
Fixed.

>
> > +	;	depends_on_mercury_calls.
> > +			% Whether or not the foreign code throws an
> > +			% exception depend on whether it makes alls back
> > +			% to Mercury (all foreign procs that don't make
> > +			% calls back to Mercury cannot cause an exception
> > +			% to be thrown).
>
> They may, since throw itself may one day be implemented as a foreign proc.
> However, that can be handled with a comment that any such predicate should
> have a fake may_call_mercury annotation.
>
I think the problem here is that the documentation is inaccurate.
`will_not_throw_exception' should not be applied to foreign procs
that have determinism erroneous.  Erroneous foreign procs, whether
they make calls back to mercury or not, should always be marked
as throwing an exception.  I'll modify the exception analysis so
that will_not_thorw_exception cannot be applied to erroneous preds.

> > +MCFLAGS-promise_will_not_thorw=--analyse-exceptions
>
> That is misspelt.
>
Fixed.

Cheers,
Julien.



--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list