Re: A few JPL (Java <-> Prolog interface) questions
- From: Jan Wielemaker <jan@xxxxxxxxxxxx>
- Date: 16 Apr 2005 13:06:20 GMT
On 2005-04-16, Eddie Jobson <mirrormaze@xxxxxxxxx> wrote:
> 1) Is it possible to shut down and restart the JPL engine (in order to
> clear the database) without closing the application which is currently
> using it? I've tried without success JPL.halt()...
The C-interface defines PL_cleanup(). It is generally slow and
cooperation with many (foreign) library is incomplete. For JPL it would
also destroy the JPL interface :-) Why not simply use retractall/1 to
delete data you no longer want?
> 2) Is it possible to catch the Prolog output produced by JPL and pass
> it to the application (in order to create, for instance, a log window)
Not through JPL as far as I know. SWI-Prolog streams can be associated
to arbitrary objects, which is used by XPCE to bind them to various
objects that handle text. To get this in JPL, I guess JPL has to be
extended to deal with SWI-Prolog streams.
Alternatively, use the print_message/2 for printing messages (all Prolog
messages are printed this way) and define message_hook/3 to redirect them
to a window.
Cheers --- Jan
.
- References:
- A few JPL (Java <-> Prolog interface) questions
- From: Eddie Jobson
- A few JPL (Java <-> Prolog interface) questions
- Prev by Date: Re: Hash table and SWI-Prolog
- Next by Date: Re: nested list
- Previous by thread: A few JPL (Java <-> Prolog interface) questions
- Next by thread: Hash table and SWI-Prolog
- Index(es):