Home > Archive > Prolog > April 2005 > A few JPL (Java <-> Prolog interface) questions
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
A few JPL (Java <-> Prolog interface) questions
|
|
| Eddie Jobson 2005-04-16, 8:57 am |
| 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()...
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)
?
Thanks in advance!
| |
| Jan Wielemaker 2005-04-16, 3:58 pm |
| On 2005-04-16, Eddie Jobson <mirrormaze@inwind.it> 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
|
|
|
|
|