From fadushin@syr.edu  Fri Jan 21 21:48:54 2000
Received: from fadushin.ne.mediaone.net (fadushin.ne.mediaone.net [24.218.120.90])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id VAA24978;
	Fri, 21 Jan 2000 21:48:53 +0100 (MET)
Received: from syr.edu (localhost [127.0.0.1])
	by fadushin.ne.mediaone.net (8.9.3/8.9.3) with ESMTP id PAA22302;
	Fri, 21 Jan 2000 15:47:57 -0500
Sender: fadushin@fadushin.ne.mediaone.net
Message-ID: <3888C5F8.2550C811@syr.edu>
Date: Fri, 21 Jan 2000 15:47:52 -0500
From: Fred Dushin <fadushin@syr.edu>
Organization: Adiron, LLC
X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.14 ppc)
X-Accept-Language: en
MIME-Version: 1.0
To: Ovidiu Predescu <ovidiu@cup.hp.com>
CC: Jan Wielemaker <jan@swi.psy.uva.nl>, prolog@swi.psy.uva.nl
Subject: Re: problem with JPL 1.0.1 and SWI Prolog 3.3.0
References: <200001211951.LAA22973@orion.rgv.hp.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

> I have one question about SWI Prolog/JPL integration: is it possible to define
> foreign predicates in Java that could be called from Prolog? I know that I can
> call Prolog predicates from Java, but I didn't see anything in the
> documentation about the other way around.

This has not been implemented (yet).  It gets to the question I just posted to
the list: Do people *want* to see this feature?  And if so, what ideas do you
have about what the interfaces and architecture should be like?

I'm not sure how rich the reflection APIs are in Java to make this feasible.
Remember, there are no predicates to call in Java.  There are classes and class
instances, but it's not clear how to proceed from there.  The nice thing about
going from Java to Prolog is that you have a nice term structure that everything
in Prolog fits nicely into.  But the reverse direction is not as clear to me. 
The closest thing to me seems to be Java Reflection, since you can traverse the
Java type structure using it.  But it's still not clear to me how this could be
useful.

I'm throwing these ideas out there to stimulate discussion.  I haven't been
thinking to heavily about this direction lately, and I'm just curious if anyone
has any ideas about what it should look like (no less how it should function).

Does anyone know even if this sort of thing has been done elsewhere?

Fred

