Glendon Holst - 2006-05-21

Logged In: YES

Just to clarify, do you want 1) an embedded Prolog environment,
or 2) an interactive console?

If #1), JLog already does this quite well and you don't need any graphical
environment (See the APIQueens example).

If #2), JLog almost does this (again, see the APIQueens example). I do not
believe that a text-based console mode plays to the strengths of JLog (there
are several great Prolog implementations -- YAP and SWI-Prolog come to
mind -- that work on many platforms in a console mode). For now, I will
leave it as an exercise for someone to create this mode for JLog if they really
need it.

Some suggestions for those interested in doing this:

Start with the APIQueens example. Read all inputs (assume each line is the
Prolog expression), and pass them in as queries (jPrologAPI.query() method).
If the user terminates the session (e.g., ^D or ^C), then the console exits.

The exception is the consult/1 query, which JLog doesn't handle yet
(see request #1112312). A workaround would be to handle the
'consult(filename)' input separately, getting the 'filename', loading it, and then
passing it to jPrologAPI.consultSource.

The console code should catch and handle any exceptions (typically
displaying Syntax Error information).