[m-rev.] for review: multiple foreign language support
Peter Ross
peter.ross at miscrit.be
Wed Jul 18 22:29:44 AEST 2001
Tyson wrote:
> > > + globals__io_get_globals(Globals),
> > > + globals__io_get_target(Target),
> > > +
> > > + % Figure out what to do with this new clause.
> > > + % We can either add it to the list of clauses, ignore it,
> > > + % or replace the existing clause with it.
> > > + %
> > > + % We create a closure called UpdateClauses which does the
> > > + % appropriate action at the end of this predicate.
> > > + %
> > > + % In the rare case of multiple foreign language
> > > + % implementations we might do some unnecessary work only
> > > + % to ignore the new clause.
> > > + {
> > > + % no clauses -- add it
> > > + LangClauses = [],
> > > + UpdateClauses = (pred(NewCl::in, Cs::out) is det :-
> > > + Cs = [NewCl|ClauseList])
> > > + ;
> > > + % was implemented in Mercury, do nothing
> > > + % XXX if we want to make Mercury implementations a fallback
> > > + % we should consider making this a replace instead of an
> > > + % ignore.
> >
> > I don't think this XXX is correct. You already have a suitable
> > foreign_proc to use, so you would never want to use the mercury code.
>
> I think you have this around the wrong way -- this code ignores the
> foreign__proc (the new clause NewCl) if the existing clause is written
> in Mercury.
>
> > What you want to do is ignore attempts to add mercury clauses when you
> > already have a foreign_code implementation.
>
> Well yes, but this happens elsewhere.
>
> Right here we want to change it (in time) to replace mercury clauses
> with foreign_proc clauses (which is what the XXX is suggesting).
>
Sorry, yes I did have the sense of the code the wrong way around.
Pete
--------------------------------------------------------------------------
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