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

Tyson Dowd trd at cs.mu.OZ.AU
Tue Jul 31 18:47:25 AEST 2001


On 31-Jul-2001, David Overton <dmo at cs.mu.OZ.AU> wrote:
> On Mon, Jul 30, 2001 at 05:40:56PM +0200, Tyson Dowd wrote:
> > Hi,
> > 
> > This should make it easier to avoid writing foreign_procs for all those
> > "hand-coded for speed" things in the library.
> > 
> > ===================================================================
> > 
> > 
> > Estimated hours taken: 16
> > Branches: main
> > 
> > Allow foreign_proc clauses to replace Mercury definitions.
> > Or alternately viewed, allow the compiler to fall back on Mercury
> > definitions of procedures if a suitable foreign_proc clause is unavailable.
> > 
> > (This is only possible with mode-specific Mercury procedures).
> > 
> > compiler/hlds_pred.m:
> > 	Add a field to clauses_info to record whether we have any
> > 	foreign_proc clauses.
> > 
> > compiler/make_hlds.m:
> > 	Record errors if we try to add a foreign_proc that will replace
> > 	a Mercury clause that is not mode-specific, or if we try to add
> > 	a non-mode specific Mercury clause that will replace a foreign
> > 	proc.  
> 
> What do you do if there are no mode annotations on the clause, but there
> is only one mode declared for the predicate?

We give an error message.

Mercury clauses must be mode-specific if you want to mix them with
foreign_proc, even if there is only one clause.

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