[m-rev.] for review: mix mercury code with foreign_proc

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Jul 31 23:16:03 AEST 2001


On 31-Jul-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> On 31-Jul-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > > compiler/hlds_pred.m:
> > > 	Add a field to clauses_info to record whether we have any
> > > 	foreign_proc clauses.
> > 
> > It would be nice to use record syntax for the clauses_info.
> 
> We do.  Did you perhaps mean `clause'?

Oops -- yes.

> > Ideally we ought to perform semantic analysis on Mercury clauses
> > even if they are overridden by foreign language pragmas.
> > Your patch doesn't do that.  However, that can remain a wishlist item
> > for some future patch...
> 
> Yes, this would be nice, as would error checking (e.g. unused variable
> name checking) the foreign_procs even if we aren't using them.
> 
> I've submitted this as a feature request.

Great, that is a very good way to ensure that these kind of things
don't get totally forgotten.

> diff -u doc/reference_manual.texi doc/reference_manual.texi
> --- doc/reference_manual.texi
> +++ doc/reference_manual.texi
> @@ -4785,13 +4785,15 @@
>  (If you use this form, and the C code @emph{does} invoke Mercury code,
>  then the behaviour is undefined --- your program may misbehave or crash.)
>  
> -It is possible to provide both a Mercury definition, and
> -a foreign_proc definition for a procedure.
> +If there are both Mercury definitions and foreign_proc defintions for 
> +a procedures, it is implementation defined which definition is used.

s/defintion/definition/

I also propose that you add the following text

	and/or foreign_proc definitions for different languages

before the comma.

> +For pure and semipure procedures, the declarative semantics of the
> +foreign_proc definitions must be the same as that of the Mercury code.
> +The only thing that is allowed to differ is the efficiency (including
> +the possibility of nondeterminism) and the order of solutions.

s/nondeterminism/non-termination/

Otherwise that looks good, thanks.

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