[mercury-users] Problem installing with grade java

Tyson Dowd trd at cs.mu.OZ.AU
Tue Jul 24 20:35:08 AEST 2001


On 24-Jul-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:

> Your suggestion does have some merit, and would probably help *a bit*,
> but I don't think it would help *a lot*.

What I like about Holger's idea is that the technical implementation can
be much cleaner that what we have now.  Well, at least the way he has
talked about it has made me think of an interesting implemetation, but
I'm not sure if this is what he is suggesting.

For each Mercury modules that compiles into {IL, Java} create a base
clase with some abstract methods for foreign language code.  The base
class is called (say) $modulename_base.

Any pragma foreign_procs are put into a subclass of $modulename_base which 
provides implementations of the virtual methods.  If this completes the
class we call it "modulename", otherwise we call it "$modulename_base_2" or
something.

Any :- external predicates (and we will have to extend :- external a
bit to be able to specify the language that is external) are left
unimplemented.  The user has to provide an implementation of the class
(in a manner like Holger is suggesting).

Or if you want you can just implement everything to throw an exception,
and override the foreign code methods in the subclasses.

Or if you want you can do it all using interfaces.

Anyway, it's a nice idea, I'd like to explore it a bit further.

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



More information about the users mailing list